Making a jar file


Simple useage

jar cf <filename>.jar <filelist>

Instructions

The jar (java archive) utility lets you combine many files into a single archive file. We use this mainly to enable students to turn in a large or arbitrary number of files. To create a jar file, go to the command prompt of whatever system you are using (that is, the same place from which you run javac). Change to the directory in which your files are stored. Use the following command, substituting a name of your choosing for <filename>:

jar cf <filename>.jar <filelist>

where

Note that if you intend to turn in a jar file, its name must end in ".jar"

Here are some examples of possible commands:

Fully detailed directions on the jar command can be seen at Sun's jar page.