The Manifest

The jar program automatically generates a manifest when the archive is created (unless you specify the M option). The manifest is always named manifest.mf and placed into a directory named META-INF, and is made up of one or more sections, each of which describes an entry in the archive. Sections in the manifest are separated by a blank line.

Each section in the manifest contains a series of attribute/value pairs. These pairs are used to specify various attributes of the contents of the archive. The entries in the manifest take the form attribute: value, where the attribute is immediately followed by a colon and whitespace, and then the value. The first section in the archive is used to identify the manifest version used by the archive. The name of the attribute is Manifest-Version. The only version currently supported is 1.0, so the first section of the manifest looks like this: Manifest-Version: 1.0

The version section is followed by sections that describe the elements contained in the archive. Each section contains an attribute called Name that identifies the name of the archived element. The jar program also produces some hash values for the archived element. Each of these values is entered into the manifest. The Digest-Algorithms attribute specifies one or more hash algorithms used to generate hash values for the element. This is followed by attributes for each of the algorithms, with the associated hash value.

To get a better idea of what these entries look ...

Get Developing Java Beans now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.