Using jlink to Build Java Runtimes

创建自定义JRE

参考 https://medium.com/azulsystems/using-jlink-to-build-java-runtimes-for-non-modular-applications-9568c5e70ef4

Using jlink to Build Java Runtimes

In order to use jlink in this situation, we need to generate a list of the JDK modules that the application uses. To do this, we can use the jdeps command that also comes with the JDK.
Interestingly

jdeps --print-module-deps xxx.jar
jlink --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules java.base --output jre

or

jlink --add-modules java.base --output jre

你可能感兴趣的:(Java)