Jad - the fast JAva Decompiler

What's New

NOTE: Jad is free for non-commercial use, but since the version 1.5.6 it's no longer free for commercial use. This means that Jad cannot be included into software products (especially decompilers) without my prior permission. If you want to use Jad (as a command-line utility or as a library) in your product(s) please contact me for conditions. At the same time, Jad can be used freely for personal needs in a commercial or non-commercial environments.

Jul 02, 2006: Minor update to version 1.5.8g for Windows and Mac OS X (Intel).
Jun 16, 2006: Added version for Mac OS X 10.4.6 (Intel).
Dec 21, 2005: changed contact email address to jad@kpdus.com.
Feb 29, 2004: Jad home page moved to /jad.html.
Dec 14, 2003: changed contact email address to kpdus@softhome.net.
Nov 23, 2001: the page moved to http://kpdus.tripod.com/jad.html.
Sep 15, 2001: updated jadAlign v1.01.
Aug 05, 2001: updated Jad 1.5.8e for Linux and Windows.
Jul 19, 2001: updated FrontEnd Plus v1.04.
Jul 15, 2001: added Jad for HP-UX 11.x.
Jul 15, 2001: updated FrontEnd Plus v1.03.
Jul 13, 2001: added jadAlign utility by Bernard Poulin.
Jul 12, 2001: updated FrontEnd Plus v1.02.
Jul 7, 2001: released the bug-fix version 1.5.8e for Windows.
Jun 18, 2001: alternative download locations removed because providing them violates the Yahoo Geocities Terms of Service.
May 19, 2001: released the bug-fix version 1.5.8d.
May 12, 2001: provided alternative download locations since many people reported difficulties with downloading Jad from Geocities (bogus authentication dialogs or "file not found" errors).
May 06, 2001: released the bug-fix version 1.5.8c. Added versions for Mac OS X, NetBSD 1.5.
Apr 29, 2001: released the bug-fix version 1.5.8b.
Apr 17, 2001: released the bug-fix version 1.5.8a.
Apr 14, 2001: released Jad 1.5.8 (JDK 1.3-compatible) for Windows, Linux (RH 7.0) and OS/2.
Feb 20, 2001: updated FrontEnd Plus v1.00.
Nov 14, 2000: added Jad 1.5.7g for Linux (Sparc).
Oct 15, 2000: released the bug-fix version 1.5.7g. Added FrontEnd Plus v0.08.
July 7, 2000: updated FrontEnd Plus v0.07.
July 6, 2000: added Jad 1.5.7f for BeOS 5.0.
July 4, 2000: added Jad 1.5.7f for FreeBSD 4.0 and OpenBSD 2.7. Updated the Linux versions of Jad.
June 29, 2000: released the bug-fix version 1.5.7f for Windows, Linux (RH 6.2), Solaris 8 (Intel), Solaris 7 (Sparc) and OS/2.
June 23, 2000: added Jad 1.5.7e for OS/2. Added FrontEnd Plus v0.06.
June 19, 2000: released the bug-fix version 1.5.7e. Added one Q&A.
June 10, 2000: updated FrontEnd Plus v0.05.
May 25, 2000: updated FrontEnd Plus v0.04.
Apr 26, 2000: updated FrontEnd Pro v0.03.
Mar 15, 2000: updated FrontEnd Plus v0.02.
Mar 14, 2000: added decompile.el, an add-on to JDE for GNU Emacs.
Jan 18, 2000: released the bug-fix version 1.5.7d. Added one Q&A.
Jan 13, 2000: FrontEnd v1.02 was replaced with FrontEnd Plus v0.01. Added link to FrontJad - another GUI for Jad.
Jan 10, 2000: released the bug-fix version 1.5.7c.
Dec 29, 1999: updated version for Rhapsody 5.3 (fixed the "incorrect magic" error).
Dec 20, 1999: added version for Rhapsody 5.3 (Power Macintosh, compiled by gcc 2.7.2.1). Added two Q&As to the FAQ section.
Dec 13, 1999: added a third-party GUI interface for Jad and links to other Jad-based decompilers.
Dec 04, 1999: released the bug-fix version 1.5.7a. The version for Linux compiled on RedHat 6.1.

For the list of differences from previous versions click here.

Jad main features

Jad is a Java decompiler, i.e. program that reads one or more Java class files and converts them into Java source files which can be compiled again.

Jad is a 100% pure C++ program and it generally works several times faster than decompilers written in Java.
Jad doesn't use the Java runtime for its functioning, therefore no special setup is required (like changes to the CLASSPATH variable).

Jad can be used:

Jad expects that supplied Java class files are valid ones, i.e. they can pass the Java Virtual Machine (JVM) verification successfully.

The Jad main features:

Known bugs and limitations

Download Jad

Jad has a 'beta' status (see Disclaimer). Please send bug reports with attached .class files to me.

To download Jad click on links below.
These files are ZIP archives, save them with the extension .zip and verify file sizes after download.
If you get the error "File not found", refresh the page.

Jad 1.5.8g for Windows 9x/NT/2000 on Intel platform (238600 bytes).
Jad 1.5.8g for Mac OS X 10.4.6 on Intel platform (170707 bytes, compiled by GCC 4.0).
Jad 1.5.8e for HP-UX 11.x (293214 bytes).
Jad 1.5.8e for Linux on Intel platform (214917 bytes).
Jad 1.5.8e for Linux (statically linked) (389972 bytes) - take this version if the one above crashes or displays the "seek error" message.
Jad 1.5.8d for OS/2 (288717 bytes) - OS/2 version was cross-compiled on Windows using EMX and RSXNT packages, therefore it requires EMX runtime (EMX.DLL should be enough).
Jad 1.5.8c for FreeBSD 4.0 (322311 bytes) - statically linked.
Jad 1.5.8c for OpenBSD 2.7 (334499 bytes) - statically linked.
Jad 1.5.8c for NetBSD 1.5 (324440 bytes) - statically linked.
Jad 1.5.8c for Solaris 8 on Intel platform (264751 bytes).
Jad 1.5.8c for Mac OS X (Darwin 1.3) on PowerPC platform (266264 bytes).
Jad 1.5.7g for Linux on Sun Sparc platform (180606 bytes). Many thanks to Mr. J. Harding who offered an user account on his Sparc computer.
Jad 1.5.7g for Linux on Sun Sparc platform (346221 bytes) - statically linked.
Jad 1.5.7f for Solaris 7 on Sun Sparc platform (318096 bytes) - compiled on Sun 4m (Sparc10) using GCC 2.8.1, statically linked. Works on Solaris 2.6 as well. Many thanks to Mr. R. Volpe, NY who provided an user account on his Sparc computer.
Jad 1.5.7f for BeOS 5.0 on Intel platform (245422 bytes) - statically linked.
Jad 1.5.7b for Mac OS X (Rhapsody 5.3) on PowerPC platform (372317 bytes).
Jad 1.5.7a for Solaris 7 on Intel platform (252582 bytes) - try the version for Solaris 8 instead.
Jad 1.5.5.3 for AIX 4.2 on IBM RS/6000 platform (360970 bytes).

Installation

Unzip jad.zip file into any appropriate directory on your hard drive.
This will create two files:

- an executable file named 'jad.exe' (Windows 9x/NT/2000) or 'jad' (UNIX)

- README file 'Readme.txt', which contains the short user's manual

For UNIX users: make 'jad' executable: chmod a+x jad

No further setup is required.

Graphical UIs and utilities for Jad

FrontEnd Plus is a graphical decompiler for Windows 9x/NT that uses the command-line version of Jad as its decompiling engine. FrontEnd Plus is written and supported by Martin Cowley (reflectonus@blueyonder.co.uk).

Click here to download the latest version of FrontEnd Plus (v.1.04). The size of the zip archive is 784820 bytes.

Graphical decompilers that use Jad as their decompiling engine:

FrontEnd Plus - http://www.reflectonus.pwp.blueyonder.co.uk/download.htm [02/29/2004: page not found]

NMI's Java Code Viewer - http://www.trinnion.com/javacodeviewer [02/29/2004: Discontinued]

Decafe Pro - http://decafe.hypermart.net

mDeJava - http://molesoftware.hypermart.net [02/29/2004: site not found]

FrontJad - http://www.ire.pw.edu.pl/~mszklan/frontjad.htm [02/29/2004: page not found]

DJ Java Decompiler - http://members.fortunecity.com/neshkov/dj.html

Cavaj Java Decompiler - http://www.bysoft.se/sureshot/cavaj

JavaDecompiler - http://iago-soft.iespana.es/iago-soft/jdecompiler/jdecompiler.htm (in Spanish) [02/29/2004: page not found]

JadClipse, Jad plugin for Eclipse IDE - http://sourceforge.net/projects/jadclipse

decompile.zip - an add-on to the Java Development Environment (JDE) for GNU Emacs. It automatically decompiles a class file and offers you a buffer to view or edit it. The add-on is written and maintained by Ingo Koch (ingo.koch@ikoch.de).

VajDecompiler - http://www.ibldesign.com/lorin/VAJDecompiler.shtml - Jad frontend for VisualAge for Java

decomp.zip - yet another LISP code for Emacs that runs Jad on the current buffer. Contributed by R. Mecklenburg.

jadAlign v1.01 is an utility created by Bernard Poulin (bernard@acm.org) that re-alignes Java source files produced by Jad. The resulting file can then be used for source-level debugging (i.e. stepping in the code). The size of the archive is 20942 bytes.

JADClassFileNode - an open tool by A. Sazonov that replaces the built-in decompiler in JBuilder.

JASM - Java disassembler module for NetBeans IDE.

JavaDecompiler.vim - plugin for VIM editor by David Bowers.

FAQ

Q1: Is the source code of Jad available?

A1: Currently I have no plans to release the Jad source code for any purposes including porting to other computer platforms.

Q2: What is the option -dead for?

A2: This option forces Jad to decompile the dead portions of bytecode. For example, non-optimizing compilation of the following code can produce the dead bytecode:

      if (false) 
      {
          ...
      }
This option should be on by default, but the incorrect dead bytecode can crash Jad.

Q3: Why does Jad fail to generate the throws clause in the method declarations like the one in

       int divide(int a, int b) throws DivideByZero { ... }   ?

A3: This throws clause is represented in the Java class files by the Exceptions attribute. The Java Virtual Machine itself doesn't use these attributes (well, at least, the common implementations of JVM), so they can be stripped out of the Java class files. Jad has no way of restoring this information in full if it's missing from the class file.

Q4: Why does Jad generate weird-looking static fields like class$java$lang$Float and static methods class$(String)?

A4: These fields/methods are the internal representation of the <classname>.class expression and automatically generated by compiler. For example, java.lang.Thread.class is translated into the following:

...
((class$java$lang$Thread == null) ?
    (class$java$lang$Thread = class$("java.lang.Thread")) :
     class$java$lang$Thread);
...


static Class class$(String s)
{
  try
  {
      return Class.forName(s);
  }
  catch(ClassNotFoundException ex)
  {
      throw new NoClassDefFoundError(ex.getMessage());
  }
}

static Class class$java$lang$Thread;
This is fixed in 1.5.8. The explanation for the previous versions: Jad doesn't convert all that back to the original expression, but apparently the Sun JDK 1.2 compiler is able to compile "the long format" successfully. JDK 1.3 compiler doesn't accept names containing class$, so in order to recompile the decomplied class you need to change all expressions similar to the conditional expression above to <classname>.class and remove static methods/fields whose names start with class$.

Q5: Jad refuses to decompile my class file saying "Class file version mismatch". What can I do?

A5: Use -debug option. Jad then complains about the version mismatch, but attempts to decompile the file anyway. Note that this works starting from the version 1.5.6e.

Q6: Jad fails to decompile my class file, it spits out a bunch of gotos and JVM instructions. Why is that?

A6: There could be several possible reasons: the class file has been obfuscated or it was produced by non-JDK Java compiler or some functions were inlined by Java compiler. Generally Jad works best with class files generated by Sun Java compilers. If you encounter such a behaviour, please send me a bug report with attached .class files.

Q7: How to decompile jar or zip archive with classes?

A7: "Unjar" (jar xvf <jarfile>) or unzip (using unzip or WinZip) the archive into a directory on your hard drive. Then see the next answer.

Q8: How to decompile the whole class tree?

A8: Run

      jad -r [-d<directory_for_sources>] [<other_options>] <directory_with_classes>**/*.class
On Unix the last argument should be in single quotes. For more information please read Readme.txt.

Q9: Why do I get "Class <<ambiguous>>List not found" from the compiler?

A9: There are two List classes: java.awt.List and java.util.List. If Jad generates two import directives:

	import java.awt.*; 
	import java.util.*;
and your class actually uses the List class, the compiler will complain. Prior version 1.5.7d use the command-line option -pi to prevent Jad from combining the import directives.

Q10: How to make the command-line options -ff -nonlb -space -t to be on by default?

A10: Use the environment variable JAD_OPTIONS to permanently override the default settings. The example for Windows:

	set JAD_OPTIONS=-ff+ -nonlb+ -t+ -space+

Q11: How to extract Java classes from an executable file (.exe)?

A11: Use the Java-Split utility written by the Decafe Pro team. Download it from http://decafe.hypermart.net/javasplit.htm.
Or use J++Extract from http://www.multimania.com/dolmen/productions.

Q12: What does the error message "JavaClassFileParseException: Invalid tag value 0x0" mean exactly?

A12: It means that your file is not a valid Java class and Jad was unable to parse it successfully. Either the file was broken (for example, during download) or the package this class belongs to contains a custom Java class loader that modifies (or decrypts) Java classes after reading them into the memory. In both cases Jad cannot decompile this file as it is.

E-mail for contacts

If you have any questions, bug reports or comments regarding Jad, please send e-mail to jad@kpdus.com.

Disclaimer

Copyright 1997-2001 Pavel Kouznetsov. All rights reserved.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

THE SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE IN ON-LINE CONTROL OF AIRCRAFT, AIR TRAFFIC, AIRCRAFT NAVIGATION OR AIRCRAFT COMMUNICATIONS; OR IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY NUCLEAR FACILITY. THE AUTHOR DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR SUCH USES. YOU MUST REPRESENT AND WARRANT THAT YOU WILL NOT USE THE SOFTWARE FOR SUCH PURPOSES.


This page has been visited many times since December, 1997