如何在Eclipse Helios中运行Java Decompiler / JD / JD-Eclipse [英] How to get Java Decompiler / JD / JD-Eclipse running in Eclipse Helios

查看:442
本文介绍了如何在Eclipse Helios中运行Java Decompiler / JD / JD-Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,推荐Java Decompiler(JD)作为一个好的,很好的Java Decompiler。 JD-Eclipse是JD的Eclipse插件。



我在几台不同的机器上遇到问题,让插件运行。每当我尝试打开一个.class文件时,标准的Source not found编辑器将显示,显示低级字节码反汇编,而不是从反编译器预期的Java源代码输出。



http://java.decompiler.free.fr/?q=中安装文档jdeclipse 不错,但是在排除故障时却很模糊。



打开此问题以收集其他信息:在Eclipse Helios中运行JD之前遇到什么问题?这是什么解决方案?

解决方案

这是我碰到的东西:



1)RTFM并在安装文档的顶部安装
中的Microsoft Visual C ++ 2008 SP1可再发行包。我最初错过了这个,因为Helios的说明是结束的。



2)打开一个类文件之前关闭所有打开的编辑器选项卡。否则,从以前的尝试中可以很容易地得到一个过时的编辑器选项卡。



3)打开Java类文件编辑器中的类文件(而不是Java类文件查看器 )。在上下文菜单中使用打开方式来获取正确的编辑器。如果对结果感到满意,请将其设置为文件关联设置中的默认编辑器,在窗口/首选项常规/编辑器/文件关联中,选择* .class以Java类文件编辑器打开。



4)这个人建议从Helios更新安装Equinox SDK现场。我做了,但我不知道这是否真的有必要。任何人都知道?



5)如果您尝试查看的类文件位于Eclipse Java项目中,则需要位于项目的构建路径中。否则,异常(不在构建路径)将显示在Eclipse错误日志中,反编译将失败。我将类文件作为库/类文件夹添加到构建路径。



6)从Windows资源管理器中拖放类文件或使用文件/打开文件...将无法正常工作。在我的测试中,我给出了一个无法打开编辑器:类文件查看器无法处理给定的输入('org.eclipse.ui.ide.FileStoreEditorInput')。错误。这可能是错误的编辑器,参见3)。



7)获取插件基本运行后,某些文件仍然无法以未知的原因反编译。关闭所有标签后重新启动Helios,然后再次尝试。


Java Decompiler (JD) is generally recommended as a good, well, Java Decompiler. JD-Eclipse is the Eclipse plugin for JD.

I had problems on several different machines to get the plugin running. Whenever I tried to open a .class file, the standard "Source not found" editor would show, displaying lowlevel bytecode disassembly, not the Java source output you'd expect from a decompiler.

Installation docs in http://java.decompiler.free.fr/?q=jdeclipse are not bad but quite vague when it comes to troubleshooting.

Opening this question to collect additional information: What problems did you encounter before JD was running in Eclipse Helios? What was the solution?

解决方案

Here's the stuff I ran into:

1) RTFM and install the "Microsoft Visual C++ 2008 SP1 Redistributable Package" mentioned at top of the installation docs. I missed this at first because the Helios instructions are at the end.

2) Close all open editor tabs before opening a class file. Otherwise it's easy to get an outdated editor tab from a previous attempt.

3) Open the class file in the "Java Class File Editor" (not "Java Class File Viewer"). Use "Open With" in the context menu to get the right editor. If pleased with results, make it the default editor in the File Association settings, in Window/Preference General/Editors/File Associations select *.class to open with "Java Class File Editor".

4) This guy recommends installing the Equinox SDK from the Helios update site. I did, but I'm not sure if this was really necessary. Anyone know?

5) If the class files you are trying to view are in an Eclipse Java project, they need to be in the project's build path. Otherwise, an exception ("Not in the build path") will show up in the Eclipse error log, and decompile will fail. I added the class files as a library / class file folder to the build path.

6) Drag/dropping a class file from Windows Explorer or opening it with File/Open File... will not work. In my tests, I gives a "Could not open the editor: The Class File Viewer cannot handle the given input ('org.eclipse.ui.ide.FileStoreEditorInput')." error. That is probably the wrong editor anyways, see 3).

7) After getting the plugin basically running, some files would still not decompile for an unknown reason. This disappeared after closing all tabs, restarting Helios, and trying again.

这篇关于如何在Eclipse Helios中运行Java Decompiler / JD / JD-Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆