在JAR中更改已编译的Java .class文件 [英] Changing the compiled java .class files in JAR

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

问题描述

我的要求:我已经解包了jar,然后在反编译中将.class文件更改为.java文件.
.java文件几乎没有错误,因为它使用了>中其他位置的方法变量之类的东西.
现在,我想将.java文件更改为.class文件,然后添加到JAR文件中,然后查看我的更改是否有效.

My requirement: I've unpacked a jar and then changed a .class file after de-compiling in to .java file.
This .java file has few errors as it uses few stuffs like methods and variable from other places which is in the JAR.
Now I want to change the .java file in to .class file and then want to add in the JAR and see my changes are working or not.

背景:

  1. 我已经解压缩了ATU Jar文件和 de-complied ATUReportsListener.class.
  2. 我现在拥有ATUReportsListener.java文件,并且进行了一些更改
  3. 现在我想再次隐蔽到.class可执行文件和文件包 进入JAR.但由于ATUReportsListener.java的内容很少 这取决于原始ATU JAR的其他文件 能够编译它.
  1. I've unpacked the ATU Jar file and the de-complied the ATUReportsListener.class.
  2. I've the ATUReportsListener.java file now and I made some changes to it.
  3. Now I want to covert to .class executable file again and the pack in to the JAR. But as the ATUReportsListener.java has few stuffs which are dependent on other files of the original ATU JAR.I'm not able to compile it.

我该怎么做?
转换为.class文件.请提供您宝贵的意见.

How would i do that?
Converting to .class file . Please give your valuable input.

推荐答案

.class文件仅在编译后创建.反编译和进行更改将不会使用相同的字节码.您需要对这些错误进行排序,然后再次进行编译

.class file is only created after compiling. decompiling and making the changes will not make it with same byte code. you need to sort those errors and compile it again

这篇关于在JAR中更改已编译的Java .class文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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