Java Bytecode Decompilers

Decompilers that read Java bytecode programs usually decompile to Java, since that is the language that the majority of such programs are written in. However, the source language could have been any of a large number of languages; see [other languages for the Java VM.

Jdec is a Java decompiler. It can be used to decompile the bytecodes present in a .class file to produce a Java source file which can be nearly correct or equivalent (due To different interpretations) to the original Java source. It also has a good UI. It is hosted on SourceForge. Currently Jdec is licenced under GPL. Visit the home site for any updates and current status.

JODE is an open source Java decompiler and obfuscator. Hosted on SourceForge under the GPL license. The core decompiler is under the LGPL, meaning that you can use it in a commercial decompiler. Written in Java. For tests see DecompilationJodeTest.

DCompiler (also known as JADO) is yet another Sourceforge open source decompiler; this one is in very alpha status. It will not decompile even the simplest test programs, so no tests have been performed.

WingSoft have a decompiler called WingDis and an obfuscator called WingGuard (see their products page).

The JReveal decompiler (www.jreveal.org) seems to be the Jasmine decompiler (version 1.1 of Mocha), with a web based GUI front end. I could not get the decompiler to work for me (Jan 2003), but you may have better luck. There is a small online paper and some examples; it looks like a really handy tool.

"Decompile Once, Run Anywhere": new.architect magazine have an archive of the classic article by Godfrey Nolan Decompile Once, Run Anywhere, which details how readily most Java programs can be decompiled. Godfrey has published a book titled "Decompiling Java".

Java Decompilation Books

"Decompiling Java": a book by Godfrey Nolan; ISBN 1590592654, APRESS August 2004. Amazon page. Note that some websites still refer to the old ISBN (0079137679); I believe that this version was never published. See also http://www.artima.com/chapters/book.jsp?num=62427. An early version of this book was available on the web. There is a whole chapter on defeating decompilers, one on decompiler design, and one on the implementation of a simple decompiler. There is little in the way of theory, e.g. structuring goto riddled code into readable Java loops and conditionals.

Java Decompiler Papers

Katsumata and Ohori published a paper describing a decompiler from bytecodes to a PCF-like language (simply typed functional language). For example, an iterative implementation of the factorial program becomes as shown below. The work is proof-directed and very theoretical, though they did build a decompiler (but not to Java, as shown below).

The Java Code Engineering pages seem to be gone forever. It had comprehensive details on Java disassemblers, decompilers, and more. The last copy of it that I am aware of is here (from http://web.archive.org).