On 31/08/2017 22:05, Daniel Latrémolière wrote:
Hi Rémi, Alan

I use already jlink to keep only useful (for me) parts of JRE/JDK, and avoid 
most big thinks (like Java UI, CORBA, RMI, etc).
Modular JAR are officially for migration [1] and are not used by modules from 
OpenJDK, even when they are pure Java. If they are a definitive target, why 
isn't it in OpenJDK a tool to transform a JMOD in a modular jar (at least when 
it is pure Java bytecode)?
As I understand jlink as an optimizer tool [2], I would try to use it for all 
modules and expect it to be able to do so. If I can not do it good, because 
they resulting image format is too much restricted, I will mitigate to have a 
less bad solution.

Many of the core modules in the JDK have native libraries, launchers, configuration files, .. and so lend themselves to the JMOD format with its defined sections for each type of resource. There are some modules in the JDK that only contain class files and a valid alternative would be for the OpenJDK build to package these as modular JARs. So don't read anything into the JDK using the JMOD format, the bulk of modules in the wider world will be packaged as modular JARs.

BTW:  The page you reference about modular JARs being "officially for migration" is an obsolete page from the exploratory phase of Project Jigsaw. I'm not sure how you got to that but it's a reminder that there are old pages that needs to be labeled as obsolete.

As regards overlaying one run-time image over another then this brings too many hazards and complications. If you want libraries of modules (which I think is what this thread is really about) then put the modular JARs in a directory. If you organize these into layers, base image, a directory for common libraries, directories for domain specific libraries, ... then they should work well when you union the file systems. The resolution that is done at startup will ensure that there aren't any missing modules and will catch other issues in the configuration too.

-Alan

Reply via email to