views:

3047

answers:

4

Is there a Java equivalent to .NET Reflector?

Edit: more specifically, decompiling is what I'm after.

A: 

I'm not super familiar with Java, but does JBrowser work for you?

swilliams
+7  A: 

From what little I know the functionality of .NET Reflector is available in pretty much all Java IDEs, including Eclipse. Just add a jar file to a projects and you can browse its classes just as you browse your own classes.

For the decompiler aspect (as opposed to the pure class browser) there are some alternatives as well. The JDK tool javap only decompiles to byte-code so it isn't really useful to get to the source code (but might help with getting an understanding of the code).

JAD is a pretty popular decompiler in the Java world and it produces compilable Java code most of the time (some bytecode sequences aren't easily translatable to valid Java 'though, so some corner cases exist).

Joachim Sauer
I'm looking for something to decompile class files if thats possible.
Paperino
I believe JAD has not been updated in a long, long time ... better off using jd-gui for this
matt b
+5  A: 

See How do I decompile Java class files? There's a link there to JD-GUI, which seems to be about what you're looking for.

Edit: Also see Open Java *.Class Files.

Edit 2: And Best free Java .class viewer?, which specifically mentions .NET Reflector.

Michael Myers
+2  A: 

You can get JAD for decompiling .class into .java. It's pretty good at it.

If you use Eclipse get the jadclipse plugin too. You'll need to configure the path to the jad.exe. Next time you open a .class you'll see the decompiled source instead of the .class declaration. And you can browse with F3 too. It's very useful.

helios