Friday, 7 June 2013

Configuring JAD decompiler and jadclipse for Eclipse in Ubuntu 13.04 / Linux

How to setup Jad and Jadclipse for Eclipse on a Linux machine. 

Personally i have had problems with this setup many times in the past So i have put together this guidelines to do the setup in a hassle free manner.

Though this guidelines have been tested only on Ubuntu 13.04 and 12.04. They should work on generally any Linux machine.

Now i am assuming you have eclipse Installed. If not please install that first.

Step 1

Download jad from this location JAD Java Decompiler Download Mirror and extract the file.


  • Download the Linux version Jad 1.5.8e for Linux on Intel platform [For me this didn't work]
  • Jad 1.5.8e for Linux (statically linked) So i downloaded this one. 
  • [don't worry about it being 32Bit/64bit.]

Step 2

Testing that Jad is working. [Optional but Recommended] 

  • Arrange for any .class file. It ok to either make one by yourself.
  • Or copy any eclipse path/plugins/*.jar file and extract it and you will find many .class there.
  • put the class file in the jad folder
  • Then go to the folder 
      cd jad158e.linux.static/ 

      ./jad <class file name>
  • A .jad file should have gotten created as classFileName.jad.
  • [If not please post a comment i will try to help you out]

Step 3

  • Move the extracted jad folder to a proper location. I recoment /opt/
      sudo mv ~/Downloads/jad158e.linux.static /opt/

Step 4 [install jadclipse]

      sudo mv ~/Downloads/net.sf.jadclipse_3.3.0.jar /opt/eclipse/plugins/net.sf.jadclipse_3.3.0.jar


Step 5

  • Change working directory to eclipse directory.  Mine is 
      cd /opt/eclipse 
      
      eclipse -clean 
  • This should start eclipse 

Step 6

  • Go to Window -> Preferences Select Java-> JadClipse 
  • set Path to de-compiler as 
      /opt/jad158e.linux.static/jad 


  • [I renamed my folder for ease so its looking a little different in the screen shot] 
  • Apply changes 

Step 7 [This is the most important step]



  •  Select General->Editors ->File Associations 
  • Ensure that you have selected the "*.class without sources" in the upper box. This is where i make mistake most of the time.
  • Select class without source on the top box Select "jadClipse Class File Viewer". 
  • Set it as "default" viewer for class files without sources. This is also very important step. 
  • Apply changes 

Step 8



  • Now close this window and open any java library file.

 
  • De-compiler should be working fine now. 


Please leave comment, any Question below. I Will be happy to answer. 
-- 
Dasvidaniya 

21 comments:

  1. Works fine.

    Note: There could be steps for installing jadClipse plugin also, as its not always the case that it would be installed. However, I did google.

    Thanks!!

    ReplyDelete
    Replies
    1. Thanks for the comment [ added a step #4 for the same ]

      Thanks again

      Delete
  2. This is great post. Thank you so much!

    ReplyDelete
  3. Hi this is Ganesh,I try to install Java Decompiler on ubuntu 12.04 .I downloaded the this file jad158e.linux.intel.zip & unzip it given ./jad i am getting error ./jad: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory

    ReplyDelete
    Replies
    1. Hi Ganesh,

      Is this working for you now?

      Delete
  4. Hi Ganesh,
    Do you have gc++ installed. If not please try installing that.

    If that doesn't work please try installing this package according to your systems architecture: https://packages.debian.org/search?mode=filename&suite=wheezy&section=all&arch=any&searchon=contents&keywords=libstdc+libc

    Please let us know how it goes.

    ReplyDelete
    Replies
    1. Hi Vikash,
      I am getting the same problem as Ganesh. I installed gc++ as you suggested, but still the problem is not solved. Please help.

      Delete
    2. Hi Anil, please share the exact error message that you are getting. Thanks

      Delete
  5. I have completed this in less time, since I found this page. Its great help to me. Thanks Vikash.

    ReplyDelete
  6. I had to give write permission to the directory where ".net.sf.jadclipse" directory has to be created. After that, it worked like a charm. Thanks dude!

    ReplyDelete
  7. Awesome Vikash. It worked in first go on Ubuntu 14.04. Thanks!

    ReplyDelete
  8. Thanks for the tutorial !!!
    I tested it and it is working with eclipse Mars 4.5.1 on ubuntu 14.04

    ReplyDelete
  9. Hi ,

    I am getting the below error :

    java.io.IOException: Cannot run program "/opt/jad158e.linux.static" (in directory "/home/ravi/.net.sf.jadclipse/1449813157173"): error=13, Permission denied

    ReplyDelete
    Replies
    1. Hi Ravi, Try to change permission by using the following command.

      chmod +x /opt/jad158e.linux.static.

      If this you have done and its not working then please reply with the output of the following command.
      ls-ltrh /opt/jad158e.linux.static

      Delete
  10. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. to de-compile all you have to do is this: ./jad

      class file is generated when you do this javac hello.java

      not sure what you mean by 'without converting it into jad file'. Please elaborate so i can reply better. thanks

      Delete
  11. This comment has been removed by the author.

    ReplyDelete
  12. Hi Vikash .Followed all your steps and this worked first time on eclipse luna version + Ubuntu 14.04 LTS . Many thanks

    ReplyDelete