Find out how JAR files containing Beans require a manifest file.
Each JAR file containing a Bean must have a manifest file, which is a text file containing information about the Bean.
This is necessary so that application builder tools can quickly analyze the manifest file and determine what Beans are in the JAR file.
Let us now examine a typical manifest file:
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 METAINF, 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 and 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
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 and each of these values is entered into the manifest.
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.
In the next lesson, how to work with JAR files using the JAR utility will be discussed.