Decompile Java Classes automatically in Eclipse with JadClipse

There always comes that time, when you’re debugging a Java application, when you get to that compiled code inside that open source jar that you added to make your life easier. Whether there’s an actual bug or you’re just trying to understand some behavior or weirdness you’re getting from calling this third party API, sometimes it just helps to see the source. If you’re using Eclipse you’re in luck, things just got easier, well they’ve been easy for awhile, but if you weren’t aware of jad they just got easier. If you download and unzip the most recent version of JAD, Java’s fast decompiler, and add the appropriate Jadclipse plug-in for your version of Eclipse, set a little configuration and your workspace will decompile compiled code automagically. No more ugly class outlines, just raw source code. This is by far one of the essential tools a Java developer should have in their tool kit, just like Firebug for a Web developer. Here are some step by step instructions to get you going, of course I’m assuming you’re already using eclipse and have an existing workspace.

  1. Download the latest version of JAD that works with your Operating System from http://www.kpdus.com/jad.html#download
  2. Unzip the JAD executable to a memorable place on your hard drive, I just stuck mine in the bin directory of the JDK
  3. Head over to http://sourceforge.net/project/showfiles.php?group_id=40205 and download the version of the Jadclipse jar that matches your eclipse version, lots of choices here 3.1, 3.2, and 3.3 are covered.
  4. Copy the jar file over to your eclipse/plugins directory, this all depends on where you unzipped and installed Eclipse
  5. If you’re workspace was open during all of this, close it and reopen it, if not open it.
  6. Click Window -> Preferences
  7. Expand +Java -> Click on JadClipse
  8. In the Path to decompiler put in the full path to JAD, or put jad in the path variable for your OS, in my case it was C:\Program Files\Java\jdk1.5.0_05\bin\jad.exe
    eclipsepref.png
  9. Now go looking in Open Type -Ctrl + Shift + T - for a class you know is in a jar or compiled in your workspace and voila it should open decompiled, classes will also decompile during navigation of method calls from the Console, or their calling classes and during debug

10 Responses to “Decompile Java Classes automatically in Eclipse with JadClipse”

  1. A great post. Thank you webguy

  2. Great and clear post man… Thanks !!! Thumbs up !!!

  3. Decompile Java Classes automatically in Eclipse with JadClipse and JAD - GreatWebGuy

    a nice post:
    Decompile Java Classes automatically in Eclipse with JadClipse and JAD - GreatWebGuy

  4. Really it’s great awesome man. J

  5. thank you so much…

  6. I’m using Linux. When I CTRL + Shift + T, and I type the class name, it does not come up. I put the jad executable in a folder in my home directory, and the jad plugin jar in the Eclipse plugins directory.

    I configured the JadClipse settings inside Eclipse as you’ve described, but no luck…

  7. I have not tried it on Linux, not sure what the problem could be, maybe a filtering issue with Ctrl + Shift + T. Can you use F3 to open compiled class to see if the JAD piece is working at least?

  8. It is really great…. Thanks a lot

  9. i am working in linux fedora ..also using fedora eclipse..i have done all the procedure…but i couldnt get class file to java file..so please help if anyone have knowledge with fedora eclipse

  10. Worked great - thanks!

Leave a Reply

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>