“Essential” (Jigsawed) Java 9 JRE without modularized code

久未见 提交于 2019-12-04 10:09:12

It is possible to create custom runtime-images of the JRE without having converted the application itself to Java 9 modules. First, we need to find out what modules (of the JDK/JRE) are needed:

"C:\Program Files\Java\jdk-9.0.1\bin\jdeps.exe"
                 -s
                 "C:\path\to\my\jars\*.jar"

Then we can create a light-weight jre directory structure (replace java.logging,java.xml with the modules required by your application):

"C:\Program Files\Java\jdk-9.0.1\bin\jlink.exe"
                 --module-path "C:\Program Files\Java\jdk-9.0.1\jmods"
                 --add-modules java.logging,java.xml
                 --output "e:\myproject\jre"
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!