Can jdeps resolve unnecessary dependencies?
Sander Mak
sander.mak at luminis.eu
Wed Sep 7 15:07:10 UTC 2016
> On 07 Sep 2016, at 16:12, Waldek Kozaczuk <jwkozaczuk at gmail.com> wrote:
>
> Will I be able to take advantage of jlink's ability to produce subset-only
> image of the JRE even if I do not use new Java 9 modular jars? In other
> words if my app.jar and other dependent jars are old java 8 ones and do not
> have any module descriptors will jlink be able to identify only needed JRE
> modules and produce minimal runtime image?
Jlink will not be able to do that for you without module descriptors, but there's an alternative solution. First, use jdeps to find all the platform modules your application needs. Then create an image using jlink with an --add-modules <platform_module> argument for each of the identified platform modules. You can then run your existing application with all application/library JARs on the classpath on top of the resulting image.
Sander
More information about the jigsaw-dev
mailing list