Opentopia Directory Encyclopedia Tools

Jar (file format)

Encyclopedia : J : JA : JAR : Jar (file format)


In computing, a JAR file (or 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.

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. If so, 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.

External links

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.

Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: