22

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.

MakePeaceGreatAgain
  • 35,491
  • 6
  • 60
  • 111
  • Have you followed the installation as described here http://jd.benow.ca/#jd-eclipse-download – SubOptimal Nov 17 '15 at 09:14
  • also remember: most decompilers aren't really up-to-date. as far as they're concerned, Lambda's, default methods, ... don't exist, so they might not be able to work with your installed version of Java – Stultuske Nov 17 '15 at 09:16
  • @SubOptimal Well, I got it from eclipse marketplace (JadEclipse). – MakePeaceGreatAgain Nov 17 '15 at 09:17
  • @HimBromBeere Could you please add the version numbers of Eclipse, the plugin and your used JDK. – SubOptimal Nov 17 '15 at 09:25
  • @SubOptimal Eclipse: Mars.1 Release (4.5.1); JadEclipse 4.0.0; JDK 1.8. However compliance for J2SE-1.4 is set within Project-->Properties-->Java Compiler – MakePeaceGreatAgain Nov 17 '15 at 09:38

4 Answers4

80

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

Monsif EL AISSOUSSI
  • 2,296
  • 19
  • 17
  • This is wild to me. I wonder why it sets itself as the default for `.class` but not `.class without source`? To me, I think more people would care about the second. – Captain Man Feb 24 '20 at 17:22
  • Seems to be a known issue: https://github.com/ecd-plugin/ecd/issues/43 – Captain Man Feb 24 '20 at 17:26
5

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.

Gaurav
  • 3,615
  • 2
  • 27
  • 50
MakePeaceGreatAgain
  • 35,491
  • 6
  • 60
  • 111
0

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.

lifesoordinary
  • 123
  • 2
  • 9
0

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

pojo-guy
  • 966
  • 1
  • 12
  • 39