Re-compile a Java Class from Jar

后端 未结 6 1361
长情又很酷
长情又很酷 2020-12-16 05:08

I have an executable jar that has one class file with a wrong value. I requested that file from the author and corrected the value.

Now I want to compile it and add

6条回答
  •  孤街浪徒
    2020-12-16 05:37

    I'd try this approach (and it should work, unless the 'debugged' class doesn't introduce a new error):

    1. create a new jar by taking the old one and deleting the classfile that you want to replace
    2. compile the corrected java file and make sure that the modified jar is on the classpath
    3. add the newly compiled classfile to the jar

    This should work. If not - ask the author for a new complete library.

提交回复
热议问题