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

后端 未结 4 1488
暗喜
暗喜 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: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.

提交回复
热议问题