JAR (file format)
From Free net encyclopedia
{{Infobox file format | name = Java Archive | icon = Image:Nuvola mimetypes java jar.png | extension = .jar | mime = | creatorcode = | owner = Sun Microsystems | genre = data compression | containerfor = | containedby = | extendedfrom = | extendedto = }} In computing, a JAR file (or Java Archive) is a ZIP, RAR, or tar 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. OpenDocument files are also Java archives which store XML files and other objects.
JAR files can be created and extracted using the "jar" command that comes with the JDK. Alternatively it can be done using zip tools.
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
A JAR file can be digitally signed, the signature information is added to the manifest file.
Such JAR files 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.
GNU jar or fastjar
The GNU Project has implemented the jar command by a program written in C language. This variant claims to be much faster than the original Sun Microsystems jar program (written in Java language). GNU jar is released under GNU General Public License (GPL).
There is not much documentation around for this utility. GNU Project has this brief introduction. However, this is the jar version distributed with many Linux distributions and also with Cygwin for windows.
See also
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. See the website of ARJ Software, Inc.