Tuesday, October 14, 2008

Java Archive

The Java Archive (JAR) file format enables you to bundle multiple files into a single archive file.

To process/manipulate/create/extract jar file use

jar[option] jar-file command

The name of the specification.
The title of the specification.
The version of the specification.
The vendor of the specification.
The title of the implementation.
The build number of the implementation.
The vendor of the implementation
helps us to refer the class name of the executable jar
If you want to guarantee that all classes in a package come from the same code source, use JAR sealing.
The value of this attribute specifies the relative URLs of the extensions or libraries that this application or extension needs


Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.5.0_04-b05 (Sun Microsystems Inc.)
Main-class: abc.xyz.yourclass


Name: java/util/
Specification-Title: Java Utility Classes
Specification-Version: 1.2
Specification-Vendor: Sun Microsystems, Inc.
Implementation-Title: java.util
Implementation-Version: build57
Implementation-Vendor: Sun Microsystems, Inc.
Sealed: true
How to add jars into manifest classpath?.
Class-Path: jar1-name jar2-name directory-name/jar3-name
How to set executable class in jar file ?.
Main-Class: abc.xyz.yourclass
Why am getting NoClassDefFoundError ?
Check classpath included in manifest.mf file and jvm classpath included jar
Am I loading all the classes from the correct code base ?.
To confirm this we have to seal our package.

Name: myCompany/myPackage/
Sealed: true

JAR Tutorial | Manifest file

1 comment:

Post a Comment

Recent Posts

Unix Commands | List all My Posts


This blog intended to share the knowledge and contribute to JAVA Community such a way that by providing samples and pointing right documents/webpages. We try to give our knowledege level best and no guarantee can be claimed on truth. Copyright and Terms of Policy refer blogspot.com