Java decompiler plugin not working

37.3k views Asked by At

I have the JD-eclipse-plugin installed. I want to decompile the classes within a jar-file. So I select the jar-file within Project-Explorer and click Decompiler in the Menu. However both decompilers (JAD and JD-core) are greyed out.

I also tried the steps shown in this blog on AVAJAVA Web Tutorials. I guess the blog is a bit outdated, however I can see within Windows-->Preferences-->Java-->Decompiler that Jad is correctly set up. But there is no JD-eclipse found within Preferences-->General-->Editors-->File Associations as you can see in the following image.jd-eclipse-plugin. Now I right click the jar-file within Project-Explorer, but there is no such "Attach Source File".

Did I miss anything to set up the plugin?

EDIT: I´m using the following setup: Eclipse: Mars.1 Release (4.5.1); JadClipse 4.0.0; JDK 1.8

EDIT2: Forgot to mention that I use Tomcat and want to dive into the libraries from /WebContent/WEB-INF/lib. This is not working, I cannot further collapse the jar-files.

4

There are 4 answers

0
MakePeaceGreatAgain On BEST ANSWER

Obviously I mixed the actual JD-eclipse-plugin an a plugin called JadClipse for Eclipse which is a slightly different plugin from eclipse marketplace. Thus when I followed the installation instructions of JD-eclipse, I could set the options for the screenshot posted within the question. So I set JD-eclipse as default for both *.class-files with and those without source-code.

Second mistake I did was a pretty silly and obvious one, namely that I wanted to browse the jar-files from within WEB-INF-folder of my Tomcat instead of from within Java Resources. Thus I could not dive into the jar-files at all hindering me to get to the class-level and thus to decompile those classes contained within the jar.

I hope this helps anyone outside also having trouble with the plugin for eclipse.

0
lifesoordinary On

I had the same problem but "class without source" did have decompliler viewer as default. So all I did was set class file viewer as default and then switched back and that fixed the issue.

2
Monsif EL AISSOUSSI On

For Eclipse 2018-09 , the problem was related to " class without source "

  • I had resolved this issue by going to:

    1. Preferences
    2. General
    3. Editors
    4. File Associations
    5. Class without source

and setting decompliler viewer as default : see the following screen shot:

enter image description here

0
pojo-guy On

I had to update all of my plugins. the Procyon decompiler has this symptom when running under java 11 or later.