您的位置:首页 > 编程语言 > Java开发

Java 反编译插件在Eclipse中的配置

2016-05-16 16:42 204 查看
Jad(JAVA Decompiler)是一个Java的反编译器,可以通过命令行把Java的class文件反编译为源代码。JadClipse是Eclipse的一个插件,这个插件提供一个class文件的查看器,可以直接打开class文件查看其反编译后的源代码。

转自:http://blog.csdn.net/zljjava/article/details/7545270


Java Decompiler Plugin For Eclipse IDE

1. 下载JAD ,

1.5.8版本的jad在 http://www.softpedia.com/progDownload/JAD-Download-85911.html

将展开后的jad.exe放到某个目录,例如 c:/jad/jad.exe

2. 下载JADClipse插件

http://sourceforge.net/projects/jadclipse/files/

将展开后的net.sf.jadclipse_3.3.0.jar放入Eclipse的plugins子目录下

3. 启动Eclipse

注意:eclipse需要重新启动

4. 配置Jadclipse, 在 Windows - Preferences - Java - JadClipse下

配置Jad的路径为 C:/jad/jad.exe;

只需编辑这一个值就ok了

如下图所示





5:eclipse重新启动,即可。

6:

In Eclipse, try F3 into any class which does not has the source, Jad will decompile it automatically.

see examples :

Java代码



*jadclipse*/// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.

// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) radix(10) lradix(10)

// Source File Name: JSObject.java

package netscape.javascript;

import java.applet.Applet;

import sun.plugin.javascript.JSContext;

// Referenced classes of package netscape.javascript:

// JSException

public abstract class JSObject

{

运行过程中可能出现的错误:

1:

Java代码



/*jadclipse*/

/*

DECOMPILATION REPORT

Decompiled from: C:\Program Files\Genuitec\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\lib\rt.jar

Total time: 16 ms

Jad reported messages/errors:

Exit status: 0

Caught exceptions:

java.io.IOException: Cannot run program "jad" (in directory "C:\Documents and Settings\Administrator\.net.sf.jadclipse\1262594305781"): CreateProcess error=2, ϵͳÕҲ»µ½ָ¶

at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)

at java.lang.Runtime.exec(Runtime.java:593)

at net.sf.jadclipse.JadDecompiler.decompile(JadDecompiler.java:160)

Decompiled from: /opt/ATG/ATG10.0.2/DAS/lib/servlet.jar

Total time: 26 ms

Jad reported messages/errors:

Exit status: 0

Caught exceptions:

java.io.IOException: Cannot run program “jad” (in directory “/home/citrisys/.net.sf.jadclipse/1311068558030″): java.io.IOException: error=2, No such file or directory

at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)

错误原因:

Make sure your “jad.exe ” in existed in that folder.

配置Jadclipse, 在 Windows - Preferences - Java - JadClipse下

配置Jad的正确路径。

其他:

Juno Eclipse版本需要

配置文件关联关系,在Preference中file associations中配置*.class & *.class without source 的default editors为jad,到此就可以使用jad的反编译功能了。

配置所需的jar包和程序http://download.csdn.net/detail/zljjava/4284865

其他问题:

转自:http://www.cnblogs.com/yinhaiming/articles/1921648.html

用%JAVA_HOME%\bin\jad.exe配置Jadclipse->Path to decompiler选项,运行时出现异常,部分内容如下:

/*

DECOMPILATION REPORT

Decompiled from: E:\sidney\workspace\zxkf\WebContent\WEB-INF\classes/cache/Area.class

Total time: 0 ms

Jad reported messages/errors:

Exit status: 0

Caught exceptions:

java.io.IOException: Cannot run program "%JAVA_HOME%\bin\jad.exe" (in directory "E:\sidney\workspace\zxkf\WebContent\WEB-INF\classes\cache"): CreateProcess error=2, ϵͳÕҲ»µ½ָ¶

at java.lang.ProcessBuilder.start(Unknown Source)

at java.lang.Runtime.exec(Unknown Source)

经多方尝试,发现只要把Jadclipse->Path to decompiler选项改成,如E:\sidney\jdk1.5.0_04\bin\jad.exe的绝对路径,一切又正常了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: