Home > Java > javaTutorial > body text

What is Multi-Release jar (mrjar) in Java 9?

WBOY
Release: 2023-08-20 20:41:15
forward
757 people have browsed it

Java 9中的Multi-Release jar(mrjar)是什么?

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.

This

mrjar 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>
Copy after login

In the above template, the jar contains four class files and a

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>
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template