- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is a Multi-Release jar(mrjar) in Java 9?
A multi-release jar(also known as mrjar) contains the same release of a library for multiple Jdk versions. It means that we can have a library as mrjar that works for Jdk 9. The code in mrjar contains class files compiled in Jdk 9. The classes compiled with Jdk 9 may take advantage of APIs offered by Jdk 9.
The mrjar can extend the already existing directory structure of a jar. It contains a root directory where all its contents reside and the META-INF directory that has used to store metadata about the jar. Typically, a jar contains a META-INF/MANIFEST.MF file that contains attributes.
The entries in a jar as below:
- jar-root - C1.class - C2.class - C3.class - C4.class - META-INF - MANIFEST.MF
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.
- 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
- How can we create a multi-release jar(mrjar) using jar tool in Java 9?
- What is the use of a multi-version compatible jar in Java 9?
- What is a JAR file?
- What is early token release and delayed token release?
- What is TCP Connection Release?
- Jar files in Java
- What is Module System in Java 9?
- What is Project Jigsaw in Java 9?
- What is Variable Handle in Java 9?
- What is a forward reference in JShell in Java 9?
- What is the JLink tool in Java 9?
- What is Http/2 Client in Java 9?
- What is Platform Logging API in Java 9?
- What is New Versioning Scheme in Java 9?
- What is Unified JVM Logging in Java 9?