简体   繁体   English

如何使用Java编辑jar文件

[英]How to edit a jar file using java

I kind of engaged in an automation process. 我有点从事自动化过程。 There I have to modify a jar file (just delete two files within )and copy it to a remote location. 在这里,我必须修改一个jar文件(只需删除中的两个文件)并将其复制到远程位置。 I tried using the solution given in How to open a .jar file within Java But it didn't help (Honestly couldn't understand). 我尝试使用如何在Java中打开.jar文件中提供的解决方案,但这没有帮助(老实说不明白)。 Regards on a kind help. 关于一种帮助。 .

如果您安装了WinRar或WinZip软件,则只需在jar文件上单击鼠标右键,然后单击“解压缩”即可在此处使用jar文件的所有内容。

通过使用以下解压缩任务,可以使用Ant脚本轻松完成此操作: http : //ant.apache.org/manual/Tasks/unzip.html

Just do a little research could help a lot. 只是做一些研究可能会有所帮助。 You can open a .jar file using winRAR then decompile the .class file as stated here How do I "decompile" Java class files? 您可以使用winRAR打开.jar文件,然后按如下所述对.class文件进行反编译。 如何“反编译” Java类文件?

To recompile you can use 'javac' in command prompt provided you listed all the classpath necessary. 如果您列出了所有必需的类路径,则可以在命令提示符下使用“ javac”进行重新编译。 How to compile a .java file in Java? 如何在Java中编译.java文件?

then you can overwrite the file in .jar 那么您可以覆盖.jar中的文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM