jlink /Jigsaw for and with migrated legacy code

Hannes H. dubaut at gmail.com
Thu Nov 15 21:41:33 UTC 2018


Good day,

I am new to this list and I apologize in advance if this is not the right
place to bring this in the discussion.

Like many others these days I work on the migration of a Java 8 code base
to OpenJDK 11. So far I managed to build and run the application with Java
11.

One of the reasons to migrate the code base was the idea to benefit from
project Jigsaw by being able to bundle a runtime with the application. I do
understand that a trimmed runtime will be only possible if the code base
and all external dependencies are as well properly modularized. This is not
the case, however, I still want to bundle a runtime with the distribution
of the application even if it is the whole JDK.

The last few days I read a lot about Jigsaw and jlink but the more I read
the more I got the impression that the only possible way would be to run
jdeps for each and every external dependency, create a module-info.java for
them and then put the module-info.java into the JAR.

That leads to my two main questions:

(1) Is my assumption right that there is no other way to bundle legacy
(=not yet modularized) code with a runtime?
(2) If (1) is true, why has this - very common - case not be targeted yet?

Thanks for your time reading my email,

Hannes.


More information about the jdk-dev mailing list