I have a Java 8 application I am working on converting to Java 11 and of course with this I am working with the module system for the first time.
I have my application Maven assembly configuration set such that all the JAR files are put in a /lib directory of the bin distribution. The maven-jar-plugin then sets the MANIFEST Class-Path value with all the JAR file names. The application is run with a simple java -jar /lib/application.jar
Moving to Java 11, if I continue to build the bin distribution this way, I'm curious to know how the runtime interprets the MANIFEST Class-Path value? I read through the JAR specs (https://docs.oracle.com/en/java/javase/11/docs/specs/jar/jar.html) and I think I understand it as:
- Any modular JAR file (contains module-info.class) will be treated as a non-modular JAR.
- Any non-modular JAR file (no module-info.class) will be treated as a non-modular JAR.
- Since everything is on the Class-Path, everything is essentially an unnamed module
- Since everything is on the Class-Path, the module system is essentially not being used at runtime
- Since everything is on the Class-Path, the application should run essentially as if it's still running as Java 8?
If I did want to change this, would I start putting any modular JAR file on the --module-path and keep the other JAR files on the Class-Path?