Java Jar Manifest

Source: Internet
Author: User

The jar file can optionally contain a META-INF file named in the directory MANIFEST.MF Manifest . ManifestThe file contains information about the jar file and its entries. The Manifest file can contain information about the settings of the jar file CLASSPATH and its main item class.

The main item class is the class that has the method to start the standalone application main() , the version information for the package, and so on.

manifestThe file is divided into sections separated by blank lines. Each section contains a name-value pair. A new row separates each name/value pair. The colon separates the name and its corresponding value.

The manifest file must end with a new line. The following is a sample manifest file:

1234 Manifest-Version: 1.0Created-By: 1.8.0_20-ea-b05 (Oracle Corporation) Main-Class: cn.sxt.MainProfile:  compact1

The above manifest file has a section with four attributes:

    • Manifest-version

    • Created-by

    • Main-class

    • Profile

Part of the jar manifest file

manifestThere are two types of parts in a file: The main part and the individual parts.

A blank line must separate any two parts. The entries in the main section apply to the entire JAR file. The entries in a single section apply to specific entries.

The properties in a single section override the same properties in the main section. A single entry begins with a "name" property whose value is the name of the entry in the jar file followed by other properties of the entry.

Click on the link to view the details

Java Jar Manifest

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.