A multi-version jar file (also known as mrjar) contains multiple ## of the same library Release of #Jdk version. This means we can have a mrjar library for Jdk 9. The code in mrjar contains class files compiled in Jdk 9. Classes compiled with Jdk 9 can take advantage of the APIs provided by Jdk 9.
Thismrjar can expand the existing directory structure of a jar file. It contains a root directory, which contains all the contents, and a META-INF directory used to store metadata about the jar file. Typically, a jar file contains a META-INF/MANIFEST.MF file, which contains the attributes.
The entries in the jar file are as follows:<strong>- jar-root - C1.class - C2.class - C3.class - C4.class - META-INF - MANIFEST.MF</strong>
MANIFEST.MF file. The mrjar extends the META- INF directory to store classes that can be specific to the Jdk version. The META-INF directory contains version sub-directory that contains many sub-directories, each of them named the same as Jdk major version. For instance, the classes specific to Jdk 9, there is a META-INF/versions/9 directory. For classes specific to Jdk 10, there is META-INF/versions/10 .
<strong>- jar-root - C1.class - C2.class - C3.class - C4.class - META-INF - MANIFEST.MF - versions - 9 - C2.class - C5.class - 10 - C1.class - C2.class - C6.class</strong>
The above is the detailed content of What is Multi-Release jar (mrjar) in Java 9?. For more information, please follow other related articles on the PHP Chinese website!