I currently involved in a project which requires to load a properties file which is located inside a jar file and i need to edit tat. I have Googled a bit and saw quite a few different ways of achieving this ALL idea says i need to rename it to .zip file and after editing again converted to .jar , but i am not satisfied with that answer because i would like to perform the editing without extracting the jar ...is there any possibility by using command prompt or using some interface.... ANY IDEA FRIENDS
JAR files are built on the ZIP file format and have the .jar file extension. you can create or extract JAR files using the jar command that comes with a JDK. You can also use zip tools to do so;
You have to know that JAR files - like any other ZIP files is in compressed format. You cannot update a file inside a zip archive without extracting it and putting it back to the archive,no matter what tool may you use (Zip,WinRar,7-Zip or jar) you are just extracting the file and editing and then putting it back to the archive.The below given answers are also doing that,but the file are being extracted to a temporary directory and you are not seeing it.
If you install 7-zip you should be able to open the jar file directly and drag the properties file out of the archive to the desktop or something. Once there you can open/edit then drag it back to the 7-zip window. That's how I do it.
Use 7zip, right click on jar and with 7z say open archive, then go to property file, double click and open file with notepad, edit it and save. Now when you will close 7z console, it will ask "update archive?" Say yes... That's it.
Yes you can, In Centos 7 and the vim version 7.4 you can edit zip or jar files zip whit out unzip. So you execute the next commands and you can edit your properties file.
vim Programm.jar 2
[Then you see a lot of directories, so you go to the specific file you wan edit and push enter then you can edit the file use vim with the vim commands.]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With