Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java decompiler plugin not working

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.

like image 838
MakePeaceGreatAgain Avatar asked Nov 17 '15 09:11

MakePeaceGreatAgain


2 Answers

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

like image 167
Monsif EL AISSOUSSI Avatar answered Oct 23 '22 09:10

Monsif EL AISSOUSSI


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.

like image 38
MakePeaceGreatAgain Avatar answered Oct 23 '22 10:10

MakePeaceGreatAgain