如何使用JLink命令为JDK9应用程序创建跨平台可执行文件 [英] How to create cross platform executables for JDK9 application using JLink command

查看:88
本文介绍了如何使用JLink命令为JDK9应用程序创建跨平台可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的JAVA-9应用程序/项目拼图创建跨平台/平台无关的可执行文件.

I am trying to create cross platform / platform independent executables for my JAVA-9 application / project jigsaw.

我认为jlink命令只会创建特定于平台的可执行文件/运行时.

I think jlink command will create only platform specific executable/runtime.

推荐答案

JLink (由 JEP 282 覆盖)创建模块化运行时映像(由

JLink (covered by JEP 282) creates modular runtime images (covered by JEP 220, particularly the section New run-time image structure). These images are a generalization of JRE, JDK, and compact profiles and are OS specific like they are. JLink can hence not be used to create cross-platform executables.

也就是说,可以在一个操作系统上运行JLink并为一个不同的操作系统创建一个运行时映像.为此,您要做的就是下载并解压缩JDK 9(与JLink的版本相同),并将其jmods文件夹放在JLink调用的模块路径上.

That said, it is possible to run JLink on one operating system and create a runtime image for a different OS. All you have to do for that is to download and unpack a JDK 9 (same version as the one JLink comes from) for that and put its jmods folder on the module path for the JLink call.

这篇关于如何使用JLink命令为JDK9应用程序创建跨平台可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆