The basic command for adding files has this format:
jar uf jar-file input-file(s)
In this command:
Any files already in the archive having the same pathname as a file being added will be overwritten.
When creating a new JAR file, you can optionally use the -C option to indicate a change of directory. For more information, see the Creating a JAR File section.
META-INF/MANIFEST.MF TicTacToe.class audio/ audio/beep.au audio/ding.au audio/return.au audio/yahoo1.au audio/yahoo2.au images/ images/cross.gif images/not.gif
Suppose that you want to add the file images/new.gif to the JAR file. You could accomplish that by issuing this command from the parent directory of the images directory:
jar uf TicTacToe.jar images/new.gif
The revised JAR file would have this table of contents:
META-INF/MANIFEST.MF TicTacToe.class audio/ audio/beep.au audio/ding.au audio/return.au audio/yahoo1.au audio/yahoo2.au images/ images/cross.gif images/not.gif images/new.gif
You can use the -C option to "change directories" during execution of the command. For example:
jar uf TicTacToe.jar -C images new.gif
META-INF/MANIFEST.MF TicTacToe.class audio/ audio/beep.au audio/ding.au audio/return.au audio/yahoo1.au audio/yahoo2.au images/ images/cross.gif images/not.gif new.gif