

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can we create a multi-release jar(mrjar) using jar tool in Java 9?
In Java 9, a new feature "multi-release jar format" has been introduced where jar format enhanced with different versions of Java class or resources that can be maintained and used as per the platform. A jar command can be used to create a multi-release jar that contains two versions of the same class compiled for both Java 8 and Java 9 versions with a warning message, telling that both classes are identical.
C:\Users\User\tutorialspoint>jar --create --file MR.jar -C sampleproject-base demo --release 9 -C sampleproject-9 demo Warning: entry META-INF/versions/9/demo/SampleClass.class contains a class thatis identical to an entry already in the jar
The " --release 9" option can tell jar to include everything that can follow (the demo package inside "sampleproject-9 "directory) inside a versioned entry in the MRJAR under "root/META-INF/versions/9".
jar root - demo - SampleClass.class - META-INF - versions - 9 - demo - SampleClass.class
- Related Questions & Answers
- What is a Multi-Release jar(mrjar) in Java 9?
- What is the use of a multi-version compatible jar in Java 9?
- How to create a JAR file?
- Jar files in Java
- How to make seleinum jar file , and how to test using Selenium jar file?
- What is a JAR file?
- How to run a JAR file through command prompt in java?
- How can we create a Service Provider interface in Java 9?
- How can we create an unmodifiable Set in Java 9?
- How can we create an unmodifiable List in Java 9?
- How can we create an unmodifiable Map in Java 9?
- How to add jar as library on Android Studio?
- How can we create an instance of VarHandle in Java 9?
- How JShell tool works internally in Java 9?
- While using SAPJco 3.0.11 with Maven, I can’t rename original archive sapjco3.jar
Advertisements