Java – How to Decompile Class files from Jar Files

How to Decompile Class files from Jar Files?

Decompiler
According to Wikipedia, A decompiler is the name given to a computer program that performs, as far as possible, the reverse operation to that of a compiler. That is, it translates a file containing information at a relatively low level of abstraction (usually designed to be computer readable rather than human readable) into a form having a higher level of abstraction (usually designed to be human readable). The decompiler does not reconstruct the original source code, and its output is far less intelligible to a human than original source code.

Java – Download Free EBooks and Whitepapers

The term decompiler is most commonly applied to a program which translates executable programs (the output from a compiler) into source code in a (relatively) high level language which, when compiled, will produce an executable whose behavior is the same as the original executable program. By comparison, a disassembler translates an executable program into assembly language (and an assembler could be used to assemble it back into an executable program).
Java De-compiler
The “Java Decompiler project” aims to develop tools in order to decompile and analyze Java 5 “byte code” and the later versions.

JD-Core is a library that reconstructs Java source code from one or more “.class” files. JD-Core may be used to recover lost source code and explore the source of Java runtime libraries. New features of Java 5, such as annotations, generics or type “enum”, are supported. JD-GUI and JD-Eclipse include JD-Core library.

JD-GUI is a standalone graphical utility that displays Java source codes of “.class” files. You can browse the reconstructed source code with the JD-GUI for instant access to methods and fields.

JD-Eclipse is a plug-in for the Eclipse platform. It allows you to display all the Java sources during your debugging process, even if you do not have them all.

Features

  • JD-Core and JD-GUI are written in C++. This allows an extremely fast decompilation and a display.
  • JD-Core does not require the Java runtime environment for its functioning, therefore no special setup is required.
  • JD-Core works with most current compilers including the following:
    • jdk1.1.8
    • jdk1.3.1
    • jdk1.4.2
    • jdk1.5.0
    • jdk1.6.0
    • jdk1.7.0
    • jikes-1.22
    • harmony-jdk-r533500
    • Eclipse Java Compiler v_677_R32x, 3.2.1 release
    • jrockit90_150_06
  • JD-Core supports the following new features of Java 5:
    • Annotations
    • Generics
    • Type “enum”
  • JD-GUI supports Drag and Drop.
  • JD-GUI supports JAR files.
  • JD-GUI displays color coded Java source code.
  • JD-GUI allows you to browse the “class” files hierarchy.
  • JD-GUI displays “log” files, and allow you to decompile “class” files appearing in Java stack traces.
  • JD-Core, JD-GUI and JD-Eclipse use the excellent cross-platform wxWidgets toolkit.

Download

Download from http://java.decompiler.free.fr/?q=jdgui

Download Java Decompiler

Download Java Decompiler

Extract jd-gui-0.3.3.windows.zip file -> Click on jd-gui Application

Slect Jar file to Decompile in JD-GUI

Slect Jar file to Decompile in JD-GUI

Decompiled Java Class from Jar File

Decompiled Java Class from Jar File

References

http://java.decompiler.free.fr/

http://en.wikipedia.org/wiki/Decompiler

No Responses

Leave a Reply