修改 jar 中的文件 [英] Modifying a file inside a jar

查看:16
本文介绍了修改 jar 中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想修改我的 jar 中的一个文件.是否可以在我的应用程序中在不提取和重新震动的情况下执行此操作?

I would like to modify a file inside my jar. Is it possible to do this without extracting and re jarring, from within my application?

我要修改的文件是配置文件,主要是基于xml的.

File i want to modify are configuration files, mostly xml based.

我对不解压感兴趣的原因是,如果我解压应用程序,它会被 launch4j 包裹,我将无法再次创建 .exe 文件.

The reason i am interested in not un jarring is that the application is wrapped with launch4j if i unjar it i can't create the .exe file again.

推荐答案

您可以为 jar

来自 Java 教程:

From the Java Tutorials:

jar uf jar-file input-file(s)

存档中已存在的任何与添加的文件具有相同路径名的文件都将被覆盖."

"Any files already in the archive having the same pathname as a file being added will be overwritten."

请参阅更新 JAR 文件.

比重新制作整个罐子要好得多.从您的程序中调用它听起来也是可能的.尝试 在 Java 中运行命令行

Much better than making the whole jar all over again. Invoking this from within your program sounds possible too. Try Running Command Line in Java

这篇关于修改 jar 中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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