Java反编译器插件不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33752956/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 15:00:57  来源:igfitidea点击:

Java decompiler plugin not working

javaeclipsejd-eclipse

提问by HimBromBeere

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.

我已经安装了 JD-eclipse-plugin。我想反编译 jar 文件中的类。所以我在 Project-Explorer 中选择 jar 文件,然后在菜单中单击 Decompiler。然而,两个反编译器(JAD 和 JD-core)都是灰色的。

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".

我还在AVAJAVA Web Tutorials 上尝试了此博客中显示的步骤。我想这个博客有点过时了,但是我可以在 Windows-->Preferences-->Java-->Decompiler 中看到 Jad 已正确设置。但是在 Preferences-->General-->Editors-->File Associations 中没有找到 JD-eclipse,如下图所示。jd-eclipse-plugin. 现在我右键单击 Project-Explorer 中的 jar 文件,但没有这样的“附加源文件”。

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

编辑:我正在使用以下设置: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.

EDIT2:忘了提及我使用 Tomcat 并想从/WebContent/WEB-INF/lib. 这不起作用,我无法进一步折叠 jar 文件。

采纳答案by HimBromBeere

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.

显然,我将实际的 JD-eclipse-plugin 和一个名为 JadClipse 的插件混合在一起,这是一个与 eclipse 市场略有不同的插件。因此,当我按照JD-eclipse安装说明进行操作时,我可以为问题中发布的屏幕截图设置选项。因此,我将 JD-eclipse 设置为带有和不带源代码的 *.class 文件的默认值。

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.

我犯的第二个错误是一个非常愚蠢和明显的错误,即我想从 Tomcat 的 WEB-INF 文件夹中而不是从 Java 资源中浏览 jar 文件。因此,我根本无法深入研究 jar 文件,这阻碍了我进入类级别,从而反编译 jar 中包含的那些类。

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

我希望这可以帮助任何在 eclipse 插件上遇到问题的人。

回答by Monsif EL AISSOUSSI

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

对于 Eclipse 2018-09,问题与“ class without source”有关

  • I had resolved this issue by going to:

    1. Preferences
    2. General
    3. Editors
    4. File Associations
    5. Class without source
  • 我已经通过以下方式解决了这个问题:

    1. 喜好
    2. 一般的
    3. 编辑
    4. 文件关联
    5. 无源类

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

并将反编译查看器设置为默认值:请参阅以下屏幕截图:

enter image description here

在此处输入图片说明

回答by lifesoordinary

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.

我遇到了同样的问题,但“没有源的类”确实有默认的反编译器查看器。所以我所做的只是将类文件查看器设置为默认值,然后切换回来并解决了问题。