This is one of the tutorials regarding eclipse to integrate – java jadclipse decompiler plugin. Jadclipse provides a plugin for eclipse to decompile the class file on fly and show the content. There are many other ways to de compile the class file and to integrate this plugin with your IDE. You can also refer – https://marketplace.eclipse.org/content/eclipse-class-decompiler. However not everytime and everywhere this may work. Lets see how to manually configure and integrate the jadclipse plugin in eclipse.
Refer http://jadclipse.sourceforge.net/wiki/index.php/Main_Page for all the details. Lets do step wise installation.
Step 1: Download the jadclipse jar from any of the source. Best available sourceforge. The link is also available in the above page.
Step 2: Put the downloaded jar file in the plugins folder of eclipse.
Step 3: Now download the executable for de-compilation from http://varaneckas.com/jad/. You can take latest required version.
Step 4: Unpack the downloaded zip file, you will have two files there one executable and one readme file. jad.exe is the required file for decompilation. Put that jad.exe file in one of the directory lets say – C:\jad\jad.exe.
Step 5: Open eclipse or restart the eclipse if already open. Go to Windows > Preferences > Java, JadClipse option will be enabled. There, set the path to decompiler, that is the executable file which will de compile the class file. Put the path for where we have kept the .exe in Step 4 and the path for temporary files.
Step 6: Set the default editor option for displaying the generated source of class files. In case the default option is not set to JadClipse class file editor then set it. See the below steps.
Here, for unavailable source of class files, set the JadClipse option so that jadclipse will generate the source for such class files and display.
Make it as default, so that you need not to explicitly open it with JadClipse option.
Now, you can see the source for all the class files. Lets check this with a simple example. Let us create a simple program.
1 2 3 4 5 6 7 8 9 10 11 12 |
package com.code2java.jadclipse; import java.util.HashMap; public class JadClipseTest { public static void main(String[] args) { HashMap<String, String> hashMap = new HashMap<String, String>(); } } |
Here, HashMap class is being used, however by default you cannot see the source of this class. But using jadclipse you can now view the source. The source will be something like-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
/*jadclipse*/// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) radix(10) lradix(10) package java.util; import java.io.*; import java.security.AccessController; import sun.misc.Hashing; import sun.misc.VM; import sun.security.action.GetPropertyAction; // Referenced classes of package java.util: // AbstractMap, Arrays, Collection, Iterator, // Map, Set, Objects, ConcurrentModificationException, // NoSuchElementException, AbstractSet, AbstractCollection public class HashMap extends AbstractMap implements Map, Cloneable, Serializable { static class Entry implements Map.Entry { public final Object getKey() { return key; } public final Object getValue() { return value; } public final Object setValue(Object obj) { Object obj1 = value; value = obj; return obj1; } ..... ..... ..... |
This is not the complete source code. However you can see it in your eclipse.
Hope this helps.
Regards,
Nikhil Naoghare.
Eclipse Class Decompiler plugin is more powerful than the jadClipse, the plugin web page is http://marketplace.eclipse.org/content/eclipse-class-decompiler
Eclipse Class Decompiler integrates JD, Jad, FernFlower, CFR, Procyon seamlessly with Eclipse and allows Java developers to debug class files without source code directly. It also integrates Javadoc and supports the syntax of JDK8 lambda expressions.