This section describes the 'jar' command to manage JAR files. 'jar' command syntax and options are provided.
"jar": A command line tool for managing JAR files. "jar" is distributed as part of the Sun JDK package.
It has some interesting features:
It can create, update or extract a JAR file.
ZIP compression is optional.
"jar" command syntax:
Create jar file
jar c[v0M]f jarfile inputfiles
jar c[v0]mf manifest jarfile inputfiles
Update jar file
jar u[v0M]f jarfile inputfiles
jar u[v0]mf manifest jarfile inputfiles
Extract jar file
jar x[v]f jarfile [inputfiles]
List table of contents of jar file
jar t[v]f jarfile [inputfiles]
where:
"c" - Creates a new JAR file.
"v" - Generates verbose output to standard output.
"0" - Specifies no compression.
"M" - Specifies no manifest file.
"f" - Specifies the JAR file name.
"m" - Specifies the manifest file name.
"u" - Updates a JAR file.
"x" - Extracts files out of a JAR file.
"t" - Displays the table of contents of a JAR file.
"jar" command is supported by the file, \j2sdk1.5.0\bin\jar.exe, if you installed JDK as in my previous chapter.