How to use JadClipse?

W

Warren Tang

Hello,

I am learning Java, and in particular inner classes now. I want to see
the code the compiler generates other than what I write. For example, I
want to see the following code(TimePrinter is an inner class, whose
outer class is TalkingClock):

warren.tang.TalkingClock$TimePrinter
{
warren.tang.TalkingClock$TimePrinter(warren.tang.TalkingClock)

public void
warren.tang.TalkingClock$TimePrinter.actionPerformed(java.awt.event.ActionEvent)

final warren.tang.TalkingClock
warren.tang.TalkingClock$TimePrinter.this$0
}

(So I am just finding something that is similar to the Reflector tool in
..NET.)

Then I found JadClipse which is an decompiler plugin for Eclipse. I've
just installed JadClipse configured it per the instructions here:
http://jadclipse.sourceforge.net/wiki/index.php/Main_Page

However I don't know how to use JadClipse. I think it should be invoked
against *.class files but I cannot see .class files in any of the views.
And I don't find other menu options that I can use...

I am still a beginner. Thanks for listening to me and can you help me?

Regards
Chunsheng Tang
 
S

Stefan Rybacki

Warren said:
Hello,

I am learning Java, and in particular inner classes now. I want to see
the code the compiler generates other than what I write. For example, I
want to see the following code(TimePrinter is an inner class, whose
outer class is TalkingClock):

warren.tang.TalkingClock$TimePrinter
{
warren.tang.TalkingClock$TimePrinter(warren.tang.TalkingClock)

public void
warren.tang.TalkingClock$TimePrinter.actionPerformed(java.awt.event.ActionEvent)


final warren.tang.TalkingClock
warren.tang.TalkingClock$TimePrinter.this$0
}

(So I am just finding something that is similar to the Reflector tool in
.NET.)

Then I found JadClipse which is an decompiler plugin for Eclipse. I've
just installed JadClipse configured it per the instructions here:
http://jadclipse.sourceforge.net/wiki/index.php/Main_Page

However I don't know how to use JadClipse. I think it should be invoked
against *.class files but I cannot see .class files in any of the views.
And I don't find other menu options that I can use...

I am still a beginner. Thanks for listening to me and can you help me?

Follow the class you are interessted in by e.g. clicking on in holding the ctrl key.
 
T

Tom Anderson

However I don't know how to use JadClipse. I think it should be invoked
against *.class files but I cannot see .class files in any of the views.
And I don't find other menu options that I can use...

Try drilling into a JAR holding class files which doesn't have a source
attachment and opening one of the classes - JadClipse should give you a
decompiled code view instead of the normal error message with disassembly.
If that works, you've got it installed right, and if not, you haven't.

Now, it sounds like what you want to do is to see a decompilation of your
own code. To do that, you'd have to find your own class files, but Eclipse
hides these away somewhere. I'm not sure if it's somewhere visible to you
- it might be visible in the resource view, but hidden in the java view.
Or not. Check your build path settings and properties, and see if you can
find a setting for where the compiled classes go (i think it's usually
$PROJECT/build/classes or something like that, BICBW). Even if you find
them, Eclipse might treat your source code as being the attached source of
those classes, and show that instead of invoking JadClipse. Your safest
option will be to jar up the class files (from the command line, probably,
although there's probably a way to do a binary-only export from Eclipse)
and drop them into a fresh project, away from the sources.

tom
 
L

Lew

Tom said:
Now, it sounds like what you want to do is to see a decompilation of
your own code. To do that, you'd have to find your own class files, but
Eclipse hides these away somewhere. I'm not sure if it's somewhere
visible to you - it might be visible in the resource view, but hidden in

Menu: Window / Show View / Navigator
the java view. Or not. Check your build path settings and properties,
and see if you can find a setting for where the compiled classes go (i [sic]
think it's usually $PROJECT/build/classes or something like that,
BICBW). Even if you find them, Eclipse might treat your source code as
being the attached source of those classes, and show that instead of
invoking JadClipse. Your safest option will be to jar up the class files

Probably correct.
 
W

Warren Tang

Hi Tom

Thanks for your hints. The JadClipse can decompile the libraries I
import, but not the *.classes I created (The navigator explorer can show
*.class files of my project).

Regards
Warren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top