February 24, 2008 at 5:39 PM
What is Jar File?
JAR files are packaged in the zip format making it more usable,. JAR file size is very small as compared to the class file. So, it is downloaded fast from internet and can used on the fly.
The JAR or Java Archive for short is a zip file format, where multiple files can be budled into a single archive file. Typically a JAR file contains the class files and auxiliary resources associated with applets and applications.
What is Manifest file?
When you create a JAR file, it automatically receives a default manifest file. There can be only one manifest file in an archive, and it always has the pathname
When you create a JAR file, the default manifest file simply contains the following:
Created-By: 1.6.0 (Sun Microsystems Inc.)
Options in the Jar command:
Jar command provides following options.
* To create a JAR file
jar cf jar-file input-file(s)
* To view the contents of a JAR file
jar tf jar-file
* To extract the contents of a JAR file
jar xf jar-file
* To extract specific files from a JAR file
jar xf jar-file archived-file(s)
* To run an application packaged as a JAR file (requires the Main-class manifest header)
java -jar app.jar
* To invoke an applet packaged as a JAR file
You learn in detail at:http://java.sun.com/docs/books/tutorial/deployment/