option u updates an existing JAR file entries or its manifest file.
The following command adds a C.class file to an existing test.jar file:
jar uf test.jar C.class
To change the Main-Class entry in its manifest file to HelloWorld class, use the following command:
jar ufe test.jar HelloWorld
Option | Meaning |
---|---|
u | indicates that you are updating a JAR file |
f | indicates that you are specifying the JAR file name, which is test.jar |
e | indicates that you are specifying the Main-Class entry's value as HelloWorld for the MANIFEST.MF file in test.jar file. |