Main Attributes of JAR Manifest File

Q

What are main attributes of a JAR manifest file?

✍: FYIcenter.com

A

Main attributes of a JAR manifest file are attributes given in the first section to provide overall information of the JAR file. Main attributes fall into the following different groups:

1. General Main Attributes:

  • Manifest-Version: Defines the manifest file version, in the format of "digit+{.digit+}*".
  • Created-By: Defines the version and the vendor of the java implementation on top of which this manifest file is generated.
  • Signature-Version: Defines the signature version of the jar file. The value should be a valid version-number string.
  • Class-Path: The value of this attribute specifies the relative URLs of the extensions or libraries that this application or extension needs. URLs are separated by one or more spaces. The application or extension class loader uses the value of this attribute to construct its internal search path.

2. Attribute for Stand-alone Application -

  • Main-Class: The value of this attribute defines the relative path of the main application class which the launcher will load at startup time. The value must not have the .class extension appended to the class name.

3. Attributes for Applets -

  • Extension-List: This attribute indicates the extensions that are needed by the applet. Each extension listed in this attribute will have a set of additional attributes that the applet uses to specify which version and vendor of the extension it requires.
  • (extension)-Extension-Name: This attribute is the unique name of the extension. The Java Plug-in will compare the value of this attribute with the Extension-Name attribute in the manifests of installed extensions to determine if the extension is installed.
  • (extension)-Specification-Version: This attribute specifies the minimum extension specification version that is required by the applet. The Java Plug-in will compare the value of this attribute with the Specification-Version attribute of the installed extension to determine if the extension is up to date.
  • (extension)-Implementation-Version: This attritute specifies the minimum extension implementation version number that is required by the applet. The Java Plug-in will compare the value of this attribute with the Implementation-Version attribute of the installed extension to see if a more recent implementation needs to be downloaded.
  • (extension)-Implementation-Vendor-Id: This attribute can be used to identify the vendor of an extension implementation if the applet requires an implementation from a specific vendor. The Java Plug-in will compare the value of this attribute with the Implementation-Vendor-Id attribute of the installed extension.
  • (extension)-Implementation-URL: This attribute specifies a URL that can be used to obtain the most recent version of the extension if the required version is not already installed.

4. Attribute for Extension -

  • Extension-Name: This attribute specifies a name for the extension contained in the Jar file. The name should be a unique identifier such as the name of the main package comprising the extension.

5. Attributes for Package -

  • Implementation-Title: The value is a string that defines the title of the extension implementation.
  • Implementation-Version: The value is a string that defines the version of the extension implementation.
  • Implementation-Vendor: The value is a string that defines the organization that maintains the extension implementation.
  • Implementation-Vendor-Id: The value is a string id that uniquely defines the organization that maintains the extension implementation.
  • Implementation-URL: This attribute defines the URL from which the extension implementation can be downloaded from.
  • Specification-Title: The value is a string that defines the title of the extension specification.
  • Specification-Version: The value is a string that defines the version of the extension specification.
  • Specification-Vendor: The value is a string that defines the organization that maintains the extension specification.
  • Sealed: This attribute defines whether this JAR file is sealed or not. The value can be either "true" or "false", case is ignored. If it is set to "true", then all the packages in the JAR file are defaulted to be sealed, unless they are defined otherwise individually.

Here is a sample of the main section of a JAR manifest file:

Manifest-Version: 1.0
Created-By: 1.4.2 (Sun Microsystems Inc.)
Implementation-Version: 1.1.1
Specification-Title: JavaBeans(TM) Activation Framework
   Specification
Specification-Version: 1.1
Extension-Name: javax.activation
Implementation-Vendor-Id: com.sun
Implementation-Vendor: Sun Microsystems, Inc.
Specification-Vendor: Sun Microsystems, Inc.

Back to FAQ on JAR (Java ARchive) File Format.

2016-04-21, 2218🔥, 0💬