A Jar file is a Java Archive file. It is a compressed archive (like a tarball on unix, a zip file on windows, or a stuffit file on Mac) that contains Java class files. It is a neat way to deliver a customer a whole bunch of compiled Java code. If you include something called a "manifest" which tells the JVM which class contains the "main" method, it can be directly executed by the JVM. Here is a simple example of creating a Jar file. > ls HelloWorld.java > javac HelloWorld.java > jar -cvf HelloWorld.jar HelloWorld.class added manifest adding: HelloWorld.class(in = 425) (out= 287)(deflated 32%) > ls HelloWorld.class HelloWorld.jar HelloWorld.java > Now you have a .jar file that you can copy to another location. You can run a main method from the HelloWorld class without having to "unpack the jar": > cp HelloWorld.jar ../dest > cd ../dest > ls HelloWorld.jar > java -classpath HelloWorld.jar HelloWorld Hello World > This example may not not be interesting, since you could have done this with the class file too. It becomes more interesting and useful when there are a large number of class files that all depend on one another; the jar file lets you copy only ONE file and be able to run a complex Java app that depends on many files. Another way to run a class from an executable jar is with the -jar switch on the java command. However, this requires the manifest to be set up correctly. Note how this command fails: > ls HelloWorld.jar > java -jar HelloWorld.jar Failed to load Main-Class manifest attribute from HelloWorld.jar > The command failed, because we have to do an additional step when creating the jar file to add the manifest properly. The example below shows how to do that. Note that the "manifest.txt" file is just a simple one-line text file created with emacs or vi, for example. > ls HelloWorld.class HelloWorld.jar HelloWorld.java manifest.txt > cat manifest.txt Main-Class: HelloWorld > jar -cvmf manifest.txt HelloWorld.jar HelloWorld.class added manifest adding: HelloWorld.class(in = 425) (out= 287)(deflated 32%) > cp HelloWorld.jar ../dest cp: overwrite ../dest/HelloWorld.jar (yes/no)? yes > cd ../dest > ls HelloWorld.jar > java -jar HelloWorld.jar Hello World > This time the java -jar HelloWorld.jar worked, because we correctly set the manifest. See also: Head First Java, 2nd Edition, p. 585-595. http://blog.ideoplex.com/software/java/antTutorial2.html