Introduction

JAR file may contain a manifest file named MANIFEST.MF in the META-INF directory.

The manifest file contains information about the JAR file and its entries.

It can contain information about the CLASSPATH setting for the JAR file.

Its main entry class is a class with the main() method to start a stand-alone application, version information about packages, etc.

A manifest file is divided into sections separated by a blank line.

Each section contains name-value pairs.

A new line separates each name-value pair. A colon separates a name and its corresponding value.

A manifest file must end with a new line.

Example

The following is a sample of the content of a manifest file:

Manifest-Version: 1.0
Created-By: 1.8.0_20-ea-b05 (Oracle Corporation)
Main-Class: com.book2s.intro.Welcome
Profile: compact1

The above manifest file has one section with four attributes:

  • Manifest-Version
  • Created-By
  • Main-Class
  • Profile

Related Topic