How to view and edit a file inside .JAR/.WAR/.ZIP file directly from console

It’s pretty common that you might want to change a configuration for a .jar or .war package. How bothering it is to unpack the archieve, find the file, do you change, delete old package, repackage – so much hassle for a little modification.
Since you landed on this page, it could get as easy as using vim editor. Did you know that .jar is essentially follows the same format as .zip. Because of that, you can use vim in following manner also with .zip and .war files. It’s just:

Brings us to interactive mode showing content of the archive.

Find the file you want change, press enter and voilà – you are changing content of jar file completely directly.



Leave a Reply

Your email address will not be published. Required fields are marked *