反编译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 补丁,这样会降低代码的可读性(会多出大量的空行)
用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 补丁,这样会降低代码的可读性(会多出大量的空行)
相关文章推荐
- WebWork深入浅出(http://www.blogjava.net/moxie/archive/2006/10/20/76375.html)
- 简化Spring(4)--View层http://www.blogjava.net/calvin/archive/2005/08/24/10914.html
- swt入门---http://www.blogjava.net/dreamstone/archive/2007/08/02/134074.html
- 理解Java ClassLoader机制 (转载http://www.blogjava.net/pandawang/archive/2006/08/20/64639.html)
- 转载http://www.blogjava.net/hadeslee/archive/2007/10/05/j3d1.html
- 让table具有滚动条(ZZ:http://www.blogjava.net/leekiang/archive/2007/09/24/147851.html)
- http://www.blogjava.net/yifeng/archive/2008/08/27/225153.html
- strtus2 批量下载 中文问题、压缩文件等 ------ 讨论struts2工作流程 (摘自:http://www.blogjava.net/xcp/archive/2009/10/30/downloadlist.html)
- http://www.blogjava.net/auditionlsl/archive/2009/05/26/278011.html
- Java基于Socket文件传输示例 --- (http://www.blogjava.net/sterning/archive/2007/10/13/152508.html)
- http://www.blogjava.net/usherlight/archive/2006/03/02/33264.html
- http://www.blogjava.net/beansoft/archive/2007/03/09/102812.html
- Eclipse Rcp系列 http://www.blogjava.net/dreamstone/archive/2007/02/08/98706.html
- Webdings字体图案 http://www.blogjava.net/majianan/archive/2007/05/04/88726.html
- 三个UNIX文件时间ctime、mtime、atime 转自:http://www.blogjava.net/yrJavaWorld/archive/2007/03/13/103602.html
- 理解Java ClassLoader机制(转自http://www.blogjava.net/pandawang/archive/2007/10/05/64639.html)
- Struts2 的基石--拦截器(Interceptor)(转载自http://www.blogjava.net/max/archive/2006/12/06/85925.html)
- lucene的中文分词器http://www.blogjava.net/dreamstone/archive/2007/06/22/125726.html
- win32下使用gcc编译供java 调用的dll须知(jni) http://www.blogjava.net/lixf/archive/2005/12/23/25177.html
- 伸展树与半伸展树Java实现 http://www.blogjava.net/javacap/archive/2007/12/19/168627.html