Edit the .properties file inside a jar without extracting it or changed to .zip format

后端 未结 4 1487
暗喜
暗喜 2021-01-13 10:49

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 fe

相关标签:
4条回答
  • 2021-01-13 11:33

    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.

    0 讨论(0)
  • 2021-01-13 11:43

    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.

    0 讨论(0)
  • 2021-01-13 11:47

    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.]

    0 讨论(0)
  • 2021-01-13 11:52

    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.

    0 讨论(0)
提交回复
热议问题