posts - 88, comments - 3, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          反編譯java class并優(yōu)雅的調(diào)試

          Posted on 2013-02-22 15:01 Milo的海域 閱讀(2055) 評(píng)論(0)  編輯  收藏 所屬分類: Java
          用jd-eclipse 插件來反編譯java class文件的輸出還是挺nice的,雖然閱讀方便了 但是對(duì)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 補(bǔ)丁讓優(yōu)雅的debug class 文件成為可能。

          如果只是為了閱讀class代碼,建議不要用realignment 補(bǔ)丁,這樣會(huì)降低代碼的可讀性(會(huì)多出大量的空行)
           
          主站蜘蛛池模板: 锦屏县| 章丘市| 巧家县| 新宁县| 来宾市| 永兴县| 顺昌县| 石柱| 钟山县| 河西区| 天全县| 泾川县| 当涂县| 鹿邑县| 金乡县| 宁国市| 峨眉山市| 满城县| 黑山县| 宁海县| 新宁县| 陵川县| 仪征市| 正蓝旗| 大石桥市| 即墨市| 北京市| 景泰县| 水城县| 互助| 德昌县| 乌兰浩特市| 南平市| 遵化市| 钟祥市| 麦盖提县| 湖南省| 台北市| 宝丰县| 伊通| 淳安县|