What do you get if you mix JEP 261 [1] with JEP 238 [2]? A Multi-release modular JAR.
This issue proposes to add support to the jar tool for creating and updating modular JAR files with an optional module-info.class in the versioned section. MRJARs are intended to target multiple releases of the Java platform, so it seems reasonable for a Multi-release modular JAR ( MRMJAR ) to be able to declare a different set of dependencies on modules that are part of the Java platform. The reasoning here is that these are implementation details rather than parts of a module's API surface, and that one may well want to change them as the JDK itself evolves. The runtime already has support for loading from the versioned section. Specifically, a versioned module descriptor must be identical to the root module descriptor, with two exceptions: - A versioned descriptor can have different non-public `requires` clauses of platform ( `java.*` and `jdk.*` ) modules, and - A versioned descriptor can have different `uses` clauses, even of service types defined outside of `java.*` and `jdk.*` modules. http://cr.openjdk.java.net/~chegar/8156497.00/ Note: while there are some new test scenarios added, which give reasonable coverage, further tests will be added later. Steve has some additional jar tools support coming for easier creation of MRJARS. -Chris. [1] http://openjdk.java.net/jeps/261 [2] http://openjdk.java.net/jeps/238