在jar中编辑.properties文件,而无需将其解压缩或更改为.zip格式 [英] Edit the .properties file inside a jar without extracting it or changed to .zip format

查看:51
本文介绍了在jar中编辑.properties文件,而无需将其解压缩或更改为.zip格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前参与一个项目,该项目要求加载位于jar文件内的属性文件,并且我需要编辑tat.我已经用Google搜索了一下,并看到了实现此ALL想法的许多不同方法,我需要将其重命名为.zip文件,并在再次编辑后将其转换为.jar,但是我对这个答案不满意,因为我想执行无需提取jar即可进行编辑...使用命令提示符或使用某些界面有任何可能....任何想法的朋友

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文件基于ZIP文件格式构建,并具有.jar文件扩展名.您可以使用JDK随附的jar命令创建或提取JAR文件.您也可以使用zip工具;

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;

您必须知道JAR文件-像任何其他ZIP文件一样都是压缩格式.您不能在不解压缩zip档案的情况下更新zip档案中的文件,无论您使用哪种工具(Zip,WinRar,7-Zip或jar),都只是解压缩文件并进行编辑,然后将其放置回到档案.下面给出的答案也可以这样做,但是文件正在提取到一个临时目录中,您看不到它.

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.

这篇关于在jar中编辑.properties文件,而无需将其解压缩或更改为.zip格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆