Main Tutorials

Java decompiler plugin for Eclipse IDE

In Eclipse IDE, we can use Enhanced Class Decompiler plugin to decompile Java class files without source code directly.

After installing and configuring the Enhanced Class Decompiler plugin, click on the class or methods, press F3, and the plugin will automatically decompile the Java class.

Table of contents

P.S Tested with Enhanced Class Decompiler v3.2.2 and Eclipse IDE 2021-06.

1. What is Enhanced Class Decompiler plugin?

The Enhanced Class Decompiler plugin can choose the following five Java decompiler tools to decompile the Java class without source code.

P.S I choose FernFlower, because the IntelliJ IDEA also using FernFlower to decompile Java class.

2. How to install Enhanced Class Decompiler plugin

Below are the steps to install the Enhanced Class Decompiler plugin in Eclipse IDE.

  1. Launch Eclipse IDE.
  2. Click Help -> Eclipse Marketplace....
  3. Search "Java Decompiler" or "Enhanced Class Decompiler".
  4. Select the "Enhanced Class Decompiler".
  5. Click the Install button.
  6. Select all features and clicks Confirm.
  7. For security warning, clicks Install anyway.
  8. Done and restart Eclipse IDE.

eclipse java decompiler 1

eclipse java decompiler 2

eclipse java decompiler 3

3. How to configure file associations

Below are the steps to configure the class without source to Class Decompiler Viewer.

  1. In Eclipse IDE.
  2. Clicks Window -> Preferences -> General -> Editors -> File Associations.
  3. In File types section, select *.class without source.
  4. Scroll down to the Associated editors section, select Class Decompiler Viewer, clicks Default button. If the Class Decompiler Viewer is missing, clicks Add button to add a new Class Decompiler Viewer. The key is to make this the default.
  5. Click Apply and Close button.

eclipse file associations

Done, click on class or method without the source code, press F3, and the plugin will automatically decompile the class files.

4. How to configure Enhanced Class Decompiler

Click on Window > Preferences > Java > Decompiler to configure which default class decompiler to decompile Java class.

configure enchanced class decompiler

5. Decompile JDK source code

This Enhanced Class Decompiler plugin seems unable to decompile the JDK source code correctly; I’m not sure if I have configured it correctly; it is always a blank page or empty source while I try to decompile the JDK source code (Java 11).

The JDK source code is in the path $JAVA_HOME\lib\src.zip, attach it, and we no need the plugin to decompile it.

Terminal

# JDK source code
C:\opt\jdk-11.0.1\lib\src.zip  

6. References

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
8 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Diego Villarroel
10 years ago

Hey guys!

if you had follow all this steps but still doesnt work you should do this:

– Window
– Preference
– General
– Editors
– File Association

*.class without source
Associated Editors -> Add
search for JadClipse Class File Viewer

Then Press “Default”, then when you press F3 button will open the “.class” source file and decompile it!

regards 🙂

surya
10 years ago

Thanks a lot , it worked for me in Helios version

Sourav Ken
10 years ago

First I will thanks to MKYong for his excellent way of sharing knowledge.

@Diego: Thanks for the tip. Though I did it in the past and I do not remember I need to do the other part that is class file without source. I guess it could be the case in the older version of the eclipse this is happening automatically. Atleast in the current version (Eclipse Kepler) I am using your tip worked for me. Thanks again. 🙂

venkat
2 years ago

Thank you

al c
4 years ago

how do you use this with Mac? F3 does not work

Vivek
12 years ago

very useful, simplified, accurate and to the point guide.
Thanks a lot.