Search code examples
javajava-modulejava-platform-module-system

What is the equivalent to JAR file META-INF/MANIFEST.MF for a JIMAGE file?


I work primarily with Scala, which up until now has been most compatible with Java 8. However, I've been kicking the tires of Java 11, and one particular element of the switch to modules has intrigued me ...

When dealing with a library packaged in a JAR file, it's fairly straightforward to retrieve information about it by examining the standard attributes in the embedded META-INF/MANIFEST.MF file, such as the implementation and specification vendor, title & version, etc. (OK, so that file, or some of these attributes, may be missing, but they're typically available for what I use.)

However, it seems that the new JIMAGE format explicitly forbids the use of a META-INF/MANIFEST.MF file. (See this bug report as one example.)

Is there a way to specify and retrieve the corresponding information for a library packaged in a JIMAGE file? In particular, I would like to both define and obtain the equivalent values for the following standard manifest attributes:

  • Implementation-Title
  • Implementation-Vendor
  • Implementation-Version
  • Specification-Title
  • Specification-Vendor
  • Specification-Version

Solution

  • The jimage format is only used internally, to store the class files that are part of the JDK. It’s not a general format for packaging libraries and is not available for use outside of the JDK.