Changing the code of the class from jar file

后端 未结 3 1108
半阙折子戏
半阙折子戏 2021-01-03 06:49

How can I read (load) the java class from jar file, add some code to the class and then put back to the jar? I need to write a script (a java code) which does all these thin

3条回答
  •  半阙折子戏
    2021-01-03 07:48

    A jar is just a ZIP file, so you can extract it with any archive manager like 7-ZIP. It will contain class files, which are compiled Java files. You need a Java decompiler to read and modify the bytecode.

提交回复
热议问题