In the MANIFEST.MF
file found in JARs, the first line is Manifest-Version: 1.0
. According to the Java Tutorials, this first line says that "the default manifest conforms to version 1.0 of the manifest specification".
So in what cases would the Manifest-Version
be anything other than 1.0
?
Also, what is the manifest specification? Why must the default manifest conform to it? I've seen multiple explanations explaining again that "the default manifest conforms to version 1.0 of the manifest specification" but none explaining what the manifest specification is.
A file with . mf extension is a Java Manifest file that contains information about the individual JAR file entries. The MF file itself is contained inside the JAR file and provides all the extension and package-related definition. JAR files can be produced to be used as an executable file.
The manifest is a special file that can contain information about the files packaged in a JAR file. By tailoring this "meta" information that the manifest contains, you enable the JAR file to serve a variety of purposes.
The manifest file is named MANIFEST. MF and is located under the META-INF directory in the JAR. It's simply a list of key and value pairs, called headers or attributes, grouped into sections.
A manifest file in computing is a file containing metadata for a group of accompanying files that are part of a set or coherent unit. For example, the files of a computer program may have a manifest describing the name, version number, license and the constituent files of the program.
The JAR File Specification - Manifest Specification states,
Manifest-Version: Defines the manifest file version. The value is a legitimate version number, as described in the above spec.
And version number is
version-number : digit+{.digit+}*
There is also a note
Versions:
Manifest-Version and Signature-Version must be first, and in exactly that case (so that they can be recognized easily as magic strings). Other than that, the order of attributes within a main section is not significant.
I don't believe Sun or Oracle has ever released another version of the Manifest Specification (but they could, and this allows them to provide future proofing). Also, it's treated as a magic string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With