Open the archive
Open the .jar, .war, .ear or .zip in Peek and find the file you want to change.
How-to · Peek Pro
You need to change one value in application.properties inside a WAR. The usual route is to unpack it, edit, and repack with the right paths and without a stray .DS_Store. Both ways below change the file in place.
With Peek
Opening the file is free. Saving the change back into the archive needs Peek Pro, which you can try free for 14 days.
Open the .jar, .war, .ear or .zip in Peek and find the file you want to change.
Use Open With to open the entry in your editor. Peek prepares a working copy of that one file.
Save in the editor. Peek notices that the working copy changed.
Before anything is written, Peek shows a text diff of what you changed.
Confirm, and Peek writes that file back into the archive. A ZIP-based archive such as a JAR or a WAR is updated in place.
From the Terminal
Both tools store the path exactly as you type it, so the file has to sit at the same relative path as inside the archive.
# Take the file out, keeping its path
unzip app.war WEB-INF/classes/application.properties
# Edit it, then put it back
jar uf app.war WEB-INF/classes/application.properties
# The same with zip
zip app.war WEB-INF/classes/application.properties
Run it from the wrong folder and you add a second copy of the file at a different path, with the old one still there. List the archive afterwards to check.
Questions
Yes. Changing any signed entry invalidates the signature, whichever tool you use. Peek warns you before you edit a signed package.
Yes. With Peek Pro you can add, move, rename, duplicate and delete entries without unpacking and repacking.
The edit changes the archive you opened. Work on a copy if you need the original untouched.
You can replace a .class with one you compiled. Peek does not edit bytecode or decompile to Java source.
More how-to guides
Free to download
Peek is a native Mac app from the Mac App Store. Nothing is charged when the trial ends; Peek Pro is a one-time purchase, with no subscription and no account.