1

I am using jar -uf to update my MANIFEST.MF file like this:

a. jar xf jarfile.jar META-INF\MANIFEST.MF

b. edit the file

c. jar uf jarfile.jar META-INF\MANIFEST.MF

But the 'uf' command is removing MANIFEST.MF from within my jar. What is the right way to change a file inside a jar (windows 7, jdk 1.6)?

jacob
  • 1,397
  • 1
  • 26
  • 53

3 Answers3

1

You can always use winrar (or any equivalent) to open the jar, and drag/drop the files. worked for me.

Simiil
  • 2,281
  • 1
  • 22
  • 32
1

For updating the manifest file the jar command provides different option -

jar umf manifest jar-file
The m option indicates that you want to update the JAR file's manifest.
manifest is the manifest whose contents you want to merge into the manifest of the existing JAR file.

examples @ http://java.sun.com/developer/Books/javaprogramming/JAR/basics/update.html

Jayendra
  • 52,349
  • 4
  • 80
  • 90
0

There is a special option (m) for the manifest file: http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/jar.html

Could you try with

jar um jarfile.jar META-INF/MANIFEST.MF
Laurent Legrand
  • 1,104
  • 6
  • 6