您的位置:首页 > 理论基础 > 计算机网络

反编译java class并优雅的调试--http://www.blogjava.net/miaoyachun/archive/2013/02/22/395575.html

2017-09-21 09:55 756 查看
https://sourceforge.net/projects/realignmentjd/files/ 官方文档

用jd-eclipse 插件来反编译java class文件的输出还是挺nice的,虽然阅读方便了 但是对debug确造成一定的困扰,主要问题是line number的不match.

Google了下遇到类似问题的真不少。最终找到了解决方案:
http://sourceforge.net/projects/realignmentjd/files/
-----------------

1. Download JD-Eclipse and JD-GUI - http://java.decompiler.free.fr/ and install.

2. Put a file realignment.jd.ide.eclipse_1.0.2.jar in eclipse/plugins directory.

    To use Realignment feature it is necessary to open the menu Preferences/General/Editors/File Associations and to select "*.class" file type and to choose "Realignment for JD Class File Editor" for Associated editors.

    Another possibility is the batch realignment after processing JD-GUI. To work properly you must to switch on the property "Display line numbers" in Help/Preferences of JD-GUI.

    To use this feature it is necessary to open the menu Preferences/Java/Decompiler/Batch Realignment and click button "Open dialog". Existing limitation: the realignment is performed only for the methods.

    To work properly it is necessary that the property "Display line numbers" in menu "Preferences/Java/Decompiler" was active.

JD-Eclipse插件 + realignment 补丁让优雅的debug class 文件成为可能。

如果只是为了阅读class代码,建议不要用realignment 补丁,这样会降低代码的可读性(会多出大量的空行)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐