Multi-release JAR files [JEP-238]
The JAR file format has been extended in the Java 9 platform and now permits multiple versions of class files to exist in a single JAR file. The class versions can be specific to a Java release version. This enhancement allows developers to use a single JAR file to house multiple releases of their software.
The JAR file enhancement includes the following:
- Support for the
JarFile
API - Support for standard class loaders
The changes to the JAR file format resulted in necessary changes to core Java tools so that they are able to interpret the new multiple-release JAR files. These core tools include the following:
- javac
- javap
- jdeps
Finally, the new JAR file format supports modularity as the key characteristic of the Java 9 platform. The changes to the JAR file format have not resulted in reduced performance of related tools or processes.
Identifying multi-release JAR files
Multi-release JAR files will have a new attribute, Multi-Release: true
. This attribute will be located...