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.
JD-IntelliJ:
-----------------------------
is a plug-in for... the IntilliJ IDE.
Let´s see very simple example using JD-core library. To download
JD-Core library for windows- click her. This zip file contains two files:
1. jad.exe
2. Readme.txt
Unzip jad.zip file into any appropriate directory on your hard drive. I extracted it on Desktop in jad158g.win folder. I just created very simple java file that is A.java:
A.java:
--------------------------------------
class A
{
public static void main(String s1[])
{
System.out.println("Hello");
}
}
Just using javac tool I got .class file and placed it into jad158g.win folder located on Desktop. Now open command prompt and point the folder containing jad.exe file and .class file like below:
C:\Users\Anyforum\Desktop\jad158g.win>jad A.class
Parsing A.class... Generating A.jad
Open newly generated .jad file in notepad. Let´s see what i got for above java file:
A.jad:
------------------------------
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: A.java
import java.io.PrintStream;
class A
{
A()
{
}
public static void main(String args[])
{
System.out.println("Hello");
}
}
So .jad file contains the valid source code, It might not be same as you write in java file because java compiler adds something in .class file as you can see in above example "default constructor"(if you don´t write any constructor in java file compiler adds default constructor by itself). If you want to generate .java file use below command:
C:\Users\Anyforum\Desktop\jad158g.win>jad -sjava A.class
Parsing A.class... Generating A.java
It´ll generate A.java file containing the java source code of A.class file. Refer Readme.txt file for more control or help command.