Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a jar, and I need to replace a class in it, at this moment, I can only open it with "archive manager" and then drag and drop the new compiled class into the jar, but I think this is really boring, if I can do with with just a command ?

Thanks ~

share|improve this question
+1 for gui being boring :), but you should correct "archive manager"... – Johan Oct 18 '10 at 5:45
up vote 6 down vote accepted
zip -u stuff.jar file.txt

will update file.txt in . Note that for -u file.txt must already exist in the zip file, and will only be overwritten if it's newer than the one in the jar.

share|improve this answer
great tip. you could probably do it with 7-zip also. – djangofan Oct 18 '10 at 5:03

what about this one

jar -uf YOURJAR.jar FILE

if the jar have a folder structure, you can keep that too


Look this one for more information

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.