jar

Name

jar---Java Archive Tool

Availability

JDK 1.1 and later.

Synopsis

jar c|t|x[f][m][v] [jar-file] [manifest-file] [files] 

Description

jar is a tool that can be used to create and manipulate Java Archive (JAR) files. A JAR file is a compressed ZIP file with an additional "manifest" file. The syntax of the jar command is reminiscent of the Unix tar (tape archive) command.

Options to jar are specified as a block of concatenated letters passed as a single argument, rather than as individual command-line arguments. The first letter of this option argument specifies what action jar is to perform and is required. Other option letters are optional. The various file arguments depend on which option letters are specified.

Options

The first argument to jar is a set of letters that specifies the operation it is to perform. The first letter specifies the basic action and is required. The three possible values are the following:

Examples

To create a simple JAR file:

% jar cvf my.jar *.java images 

To list the contents of a file:

% jar tvf your.jar 

To extract the manifest file from a JAR file:

% jar xf the.jar META-INF/MANIFEST.MF 

To create a JAR file with a partial manifest specified:

% jar cfmv YesNoDialog.jar manifest.stub anonymous/beans/yesno 

See Also

javakey