I have a .jar file and I have decompiled it using Java Decompiler, I want to modify a .class file from the .jar and recompile it. I tried to use eclipse to copy the code but it has many imports so i can't recompile it int a .class file without the imports. Is there any other solution? Is there a better approach to this ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You should on the first hand prevent these type of Fixes and Changes. But if it required, you should have all the import class's code also in order to recompile the decompiled class, as they will be required at the time of compiling, but that might not be a feasible option.
The other approach you can use is a Class Editor, which let you edit directly a class file. Get It Here
回答2:
the import directive is "sugar syntax". The compiler adds the correct package to all class references.