Saturday, 13 June 2015

How to Add Java Decompiler Plugin for Eclipse in Linux Environment ?

Decompilation is required some times , if you are interested to view internal class details of compiled java .class files. One of the interesting area is, you would like to view internal details of Thread class or any other classes in java. For that, normally what is done is to go at Java reference API site and see all the methods and interfaces. That's awful. Why not directly view all the methods and attributes in Eclipse editor itself.  Here is the Way !

Required two things : Jad  Decompiler and Eclipse Plugin for Jad Decompiler

Download and install Jad Decompiler -  Jad 1.5.8e for Linux (statically linked) from this location

Extract the tar.gz file the file names jad will be there, remember its full path name.

Now download eclipse jad  plugin jar from this source and copy it to the ./plugins directory of your eclipse.

Restart the eclipse:  Go to Preference >> Java >> You will find the plugin with name jadClipse.

Then set the path to decompiler to the path you have extracted the tar.gz file in previous step:  as for ex-  /your/Dir/jad 

Remember that : jad is the file name, do not forget to include this. You have to give full file name not the directory only. Try to open any .class complied file of java.

That's it,  you are done.  Enjoy !!

Problem : Still after setting all the above tasks properly, not able to view the Java class .
There might the problem with eclipse editor in associating Jad Plugin as the default in associated editor section. Follow Below steps in eclipse:
Windows >> Preferences >> General >> Editors >> File Associations 

Remove all Associated Editors and then add   jadclipse Class File viewer and make it default.
Restart the eclipse and Try again to re- open the file.