24

I've used DJ Java Decompiler, which has a handy GUI, but it seems as if the latest version is only a trial and forces you to purchase the software after some period of days (I recall using an earlier free version about a year ago at a previous job).

I'm aware of Jad and Jadclipse, but what I loved about DJ Java Decompiler was that it integrated with Windows Explorer - so I could simply open up a JAR in something like WinRAR, navigate thru the packages, and double-click on a .class file to view it's decompiled source.

Can anyone suggest other good, free, .class viewers? The criteria I have in mind for these would be:

  • GUI-based
  • Integrates to Windows Explorer (so I don't have to run some command-line options like with JAD)
  • optional - can also show raw JVM bytecode commands

In other words - I'd like to find the closest thing to .NET Reflector for Java as possible.

matt b
  • 138,234
  • 66
  • 282
  • 345

11 Answers11

51

JAD is one of the best Java Decompiler today. This is one brilliant piece of software. Nevertheless, the last JDK supported by JAD 1.5.8 (Apr 14, 2001) is JDK 1.3.

DJ Java Decompiler, JadClipse, Cavaj and JarInspector are powered by Jad. The last version of Decafe Pro has been released on 2002-01-03.

These viewers can not display Java 5 sources.

So, I use JD-GUI : logic, I'm the author :)

Emmanuel Dupuy
  • 1,407
  • 10
  • 12
  • Congratulations, JD-GUI worked great for me when I lost my laptop and needed some sources back in a hurry. The only thing it didn't do perfectly was the for (Thing thing : things) { loop. – Marcus Downing Jan 07 '09 at 18:00
  • 3
    JD-GUI needs a Mac version, a command line version and JadClipse integration, though... An open source licence would be great as well :) – neu242 Aug 20 '09 at 07:58
  • There's now a mac version http://java.decompiler.free.fr/?q=jdgui – Mob Nov 07 '11 at 01:35
  • JD-GUI fails to decompile types weaven by aspectj - the presented Java code is truncated. – mark Dec 08 '11 at 11:45
  • The download does not appear to work anymore. – nilskp Sep 05 '12 at 15:29
  • @Emmanuel Dupuy -- is there a command line option to pipe the output into another process? The mac command line version launches the gui. – jedierikb Nov 30 '12 at 04:08
  • @Emmanuel Dupuy: JD is a pretty solid solution, Thanks! But when decompiling some classes inside jar/dex files, it produces java files that contain " /* ERROR */" The JD-GUI used has JD Core 0.6. Now code produced by using JD-Preview (which has JD-Core 0.7.0-SNAPSHOT-20121207) is slightly better but the ERROR is still there. – thatworkshop Dec 10 '12 at 04:08
  • @idoit Thank you for your message. JD has not been designed to recognize Dalvik patterns. I am not surprised that many errors appear. I'm against piracy, but I wonder if a native Dalvik decompiler could be useful. – Emmanuel Dupuy Dec 10 '12 at 17:01
  • Fernflower is now better at decompiling, but is non-free (and the author seems to have vanished) – user253751 Jul 24 '14 at 04:14
7

Procyon is a new open source decompiler that already beats JD-GUI in most cases. It's written in Java and comes in a self-contained jar. It is actively developed by StackOverflow's own Mike Strobel.

player_03
  • 430
  • 2
  • 11
Janus Troelsen
  • 20,267
  • 14
  • 135
  • 196
5

Eclipse will allow you to view the bytecode for classes, if the source is unavailable (search for 'disassembled bytecodes').

It seems there is also a third-party plugin that uses asm here.

johnstok
  • 96,212
  • 12
  • 54
  • 76
  • The way I read it, he wants to see decompiled Java source code, not bytecode. – Michael Borgwardt Dec 19 '08 at 17:12
  • 2
    Check out JD-GUI -- it appears to be the state of the art in decompilation right now for Java: http://java.decompiler.free.fr/?q=jdgui – Drew Noakes Jun 06 '10 at 03:00
  • JD-GUI fails to decompile types weaven by aspectj - the presented Java code is truncated. – mark Dec 08 '11 at 11:44
  • I found Konloch/bytecode-viewer (https://github.com/Konloch/bytecode-viewer/releases) is good and updated. You can also see mstrobel / Procyon - Bitbucket (https://bitbucket.org/mstrobel/procyon/) – Mamun Kayum Aug 01 '18 at 09:46
3

There was another thread on StackOverflow which linked to http://java.decompiler.free.fr/

Zorantula
  • 172
  • 1
  • 2
3

Try JDGUI simple, lightweight and fast

Prabhu R
  • 13,836
  • 21
  • 78
  • 112
  • JD-GUI fails to decompile types weaven by aspectj - the presented Java code is truncated. – mark Dec 08 '11 at 11:45
1

JarInspector

Jar Inspector is an easy to use yet powerful jar file editor for Mac OS X. It allows you to effortlessly view, edit and decompile the contents of jar files.

Seki
  • 11,135
  • 7
  • 46
  • 70
dacracot
  • 22,002
  • 26
  • 104
  • 152
1

I use cavaj

I've used Decafe Pro (can't find the official site anymore) in the past, but the free version won't let you cut-n-paste.

Both of them are front ends to JAD, so they have the same features and limitations with respect to decompilation capabilities.

ykaganovich
  • 14,736
  • 8
  • 59
  • 96
0

I just published a stand-alone Java Decompiler GUI (based on Jad) which you can get from Util Java Decompiler (JAD based) v1.0

This is a Windows based .NET 4.0 application, which supports the drag n'drop of *.jar files.

It doesn't integrate with Window Explorer, but since this is based on a simple C# script, and the code is Open Source, maybe you could add that feature :)

Another idea would be to also add support for the other free java decompilers.

Dinis Cruz
  • 4,161
  • 2
  • 31
  • 49
0

There is a free Java Class Viewer, we can check the Java .class file binary data byte by byte interactively. When clicking each tree node of the class file structure on the left, the corresponding byte data would be highlighted on the right.

Here is an article describes the source code of the Java Class Viewer in detail.

Java Class Viewer

Happy
  • 757
  • 9
  • 18
0

i use cavaj, simple to install and gives your very good overview of the class, eclipse style.

Seshadri Sastry
  • 349
  • 2
  • 3
0

Many of these decompilers are based on Jad:

I like the JadClipse Eclipse plugin:

Alex Miller
  • 69,183
  • 25
  • 122
  • 167