开源工具jd-gui

来源:互联网 发布:国外邮箱数据 编辑:程序博客网 时间:2024/05/24 01:45

介绍个开源的工具 jd-gui,可以将java class 文件反编译成源码;

       下载地址: http://java.decompiler.free.fr/?q=jdgui

另有jd-eclipse ,是eclipse 的插件 ;

       地址 :http://java.decompiler.free.fr/?q=jdeclipse

安装好jdeclipse 之后,配置如下:

window-》Preferences-》General-》Editors-》File Associations -》(选择)×.class without source-(在下面的Associated editors栏目中)add -》Class file Editor(选择添加)-》(选择新的打开方式选择默认)Default

这样就可以打开class 文件了;(注 :3.x 版本的eclipse 可能没有×.class without source 这个选项,可以选x.class 试试,之后重启)


如果要debug,会发现,line number 不符合的问题,这里有个补丁可以解决这个问题,http://sourceforge.net/projects/realignmentjd/files/

配置如下:

window-》Preferences-》General-》Editors-》File Associations -》(选择)×.class -(在下面的Associated editors栏目中)add -》Realignment for JD Class File Editor(选择添加)-》(选择新的打开方式选择默认)Default

重启之后,发现打开的class文件多了很多空白行,文件中的行号和eclipse 的行号一致拉微笑