java 9: JLink created invalid images - missing module executable script

醉酒当歌 提交于 2019-12-03 14:43:51

jlink creates a runtime VM image in which it includes only the modules that are needed.

Since you specified --add-modules com.user the image will include the com.user module, and all of the modules it (directly or indirectly) depends on.

You can run your application by using the java binary in the bin folder of the generated image, and using the command:

java com.user.info.Launcher

You can also have jlink generate a launcher script using the --launcher <command>=<module>/<main> option. In your case you could do something like:

jlink --module-path $JAVA_HOME/jmods:target --add-modules com.user --output my-app --launcher launch=com.user/com.user.info.Launcher

And after that, you can just use launch from the bin directory to run the application.

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