Java Tools Tutorials - Herong's Tutorial Examples - v6.24, by Herong Yang
META-INF/MANIFEST.MF - JAR Manifest File
This section describes the JAR manifest file, META-INF/MANIFEST.MF, which contains information about the JAR file and its contents.
"manifest" in a JAR file is a file named as META-INF/MANIFEST.MF. It contains attributes about the JAR file and its contents.
Attributes in "manifest" are recorded as a list of name-value pairs in the form of "name: value\n". The list is divided into a main section for package-level attributes and multiple sub sections for entry-level attributes. Note that each attribute must be ended with a new line character.
The main section may contain only the package level attributes like:
Sub sections are optional. They are used to provide entry-level attributes with one section per entry. A sub sections must be preceded with a blank line and started with a "Name" attribute to associate this section with a content entry in the JAR file.
Here is a good example of the manifest file from the "xalan-2.7.2.jar" file:
Manifest-Version: 1.0 Created-By: 1.7.0_51 (Oracle Corporation) Main-Class: org.apache.xalan.xslt.Process Class-Path: xercesImpl.jar xml-apis.jar serializer.jar Name: org/apache/xalan/ Comment: Main Xalan engine implementing TrAX/JAXP Specification-Title: Java API for XML Processing Specification-Vendor: Sun Microsystems Inc. Specification-Version: 1.3 Implementation-Title: org.apache.xalan Implementation-Version: 2.7.2 Implementation-Vendor: Apache Software Foundation Implementation-URL: http://xml.apache.org/xalan-j/ Name: org/apache/xpath/ Comment: XPath engine Implementation-Title: org.apache.xpath Implementation-Version: 2.7.2 Implementation-Vendor: Apache Software Foundation Implementation-URL: http://xml.apache.org/xalan-j/ ...
Table of Contents
javac - The Java Program Compiler
java - The Java Program Launcher
JAR - Java Archive File Format
jar - JAR File Tool Command and Options
"jar --create" - Creating New JAR File
"jar --list" - Listing Files in JAR File
"jar --extract" - Extracting Files from JAR File
Managing JAR Files with WinZIP
►META-INF/MANIFEST.MF - JAR Manifest File
Adding META-INF/MANIFEST.MF to JAR Files
"jar -C" - Changing Input Directory
Using JAR Files in Java Class Paths
"jar --update" - Updating Class Files in JAR
"jar --main-class" - Making JAR File Executable
"jar --module-version" - Updating Module Version in JAR
jpackage - Binary Package Builder
javadoc - The Java Document Generator
jdeps - The Java Class Dependency Analyzer
jdeprscan - The Java Deprecated API Scanner
jcmd - The JVM Diagnostic Tool
jconsole - Java Monitoring and Management Console
jstat - JVM Statistics Monitoring Tool
jhsdb - The Java HotSpot Debugger
jvisualvm (Java VisualVM) - JVM Visual Tool
javap - The Java Class File Disassembler
keytool - Public Key Certificate Tool
jrunscript - Script Code Shell
native2ascii - Native-to-ASCII Encoding Converter