How to create cross platform executables for JDK9 application using JLink command

ε祈祈猫儿з 提交于 2021-01-21 12:26:37

问题


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

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


回答1:


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.

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.



来源:https://stackoverflow.com/questions/37210288/how-to-create-cross-platform-executables-for-jdk9-application-using-jlink-comman

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!