Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Manifest-Version in MANIFEST.MF?

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.

like image 825
reesjones Avatar asked Dec 15 '14 05:12

reesjones


People also ask

What does manifest MF file do?

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.

What is manifest MF in JAR?

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.

Where should manifest MF be?

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.

What does manifest mean in software?

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.


1 Answers

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.

like image 67
Elliott Frisch Avatar answered Oct 03 '22 10:10

Elliott Frisch