Reputation: 15
I decompiled a Java .jar file, after editing the problem i'm having with it, its not compiling again. So, i had to opt-in to using 7-zip to just bring out the class file and, now i've used 5 different Class Editors, all can't show me the codes like i can understand...
I used CE(Classeditor.sourceforege.net)
, dirtyjoe
, javaeditor(javaeditor.org)
, Jad
and JD-GUi
(Seems not to do its work at all)
I imported the .jar
file into Eclipse as a Project Reference Library and the most painful thing is i can see all of the class codes, but i can't edit it...It won't edit. But, it can run.
What can i do to Eclipse to be able to make it allow editing the .class
files attached to it.
EDIT: I want A Class Editor That Shows in Codes Format, not bytecodes. I have the source as well in .java format.
This Example is Eclipse Class Viewer(I want same, but not only viewer).
Eclipse Class Viewer Image, I want something similar
Upvotes: 0
Views: 791
Reputation: 9876
It sounds like you want to be able to edit class files directly. The Eclipse class viewer only works because it finds (in your project folder or online) a source code version of the jar that you're viewing. It's not actually looking at the class files and decompiling them, AFAIK. So, if you can view the source in Eclipse, your best bet may be to find the source version of the jar (on your machine or on maven, possibly, if you're using maven), and then edit it and build it yourself according to that project's build instructions. How hard that is depends on the library.
As far as being able to decompile, edit, and recompile, I'm not sure. I know that decompilers are not foolproof, and I've only used them as a last-ditch, read-only tool. It seems like it should work both ways, but I wouldn't be surprised to hear it doesn't.
Upvotes: 1