1

It is possible to add new entries to jar file using jar tool.
It is possible to modify some entries in jar file using jar tool.
But it is impossible to delete some entries from jar file.
Why?

1 Answer 1

3

One good reason is that if you remove something from a jar, you risk breaking dependencies of other classes in the jar. But, I agree that this is babying a user who may know what can safely be removed.

You can work around this easily enough by renaming the jar to a .zip file and manipulating it with your favorite .zip editor (Windows File Explorer will do this). Rename it back to a .jar when you're done. Jar files use standard zip packaging and compression...

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .