Jar (file format)
|
In computing, a Jar file (short for Java ARchive) is a ZIP file used to distribute a set of Java classes. It is used to store compiled Java classes and associated metadata that can constitute a program.
Jar files can be created and extracted using the "jar" command that comes with the JDK. Alternatively it can be done using zip tools also.
A jar file has a manifest file located in the path META-INF/MANIFEST.MF. The entries in the manifest file determine how the jar file will be used. Jar files which are intended to be executed as standalone programs will have one of their classes specified as the "main" class. The manifest file would have an entry such as
Main-Class:myPrograms.MyClass
Such jars are typically started with a command similar to
java -jar foo.jar
In JDK 1.1, the manifest file contained a list of all files contained in the jar file.
Jar files can be obfuscated so that a user of the jar file doesn't get much information regarding the code it contains.
JAR is also the name of a software tool which creates JAR files of a different kind. It is a general purpose compressed archive format and the successor of ARJ.
External link
- Using JAR files: The Basics (from Sun) (http://java.sun.com/docs/books/tutorial/jar/basics/)
- the website of ARJ Software, Inc., makers of ARJ and JAR (http://www.arjsoftware.com/)