Re-compile a Java Class from Jar

后端 未结 6 1340
长情又很酷
长情又很酷 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:34

    As others have mentioned, once you have the .class file recompiled you need to replace the older version in the .jar

    You'll likely need to have any compile time dependencies available to rebuild this class. If it's an open source project this could be an easy thing to come up with. If not, it's more difficult. If the author sent you the file he can probably help you with this as well. You might be able to get the author to produce a patched distribution for you as well. Odds are he/she already has the build environment set up and this should be relatively easy to do.

提交回复
热议问题