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) 評論(0)  編輯  收藏 所屬分類: Java
          用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 補(bǔ)丁讓優(yōu)雅的debug class 文件成為可能。

          如果只是為了閱讀class代碼,建議不要用realignment 補(bǔ)丁,這樣會降低代碼的可讀性(會多出大量的空行)
           
          主站蜘蛛池模板: 平谷区| 浮梁县| 鄯善县| 漳浦县| 东辽县| 平舆县| 贡觉县| 木兰县| 从江县| 龙里县| 呼和浩特市| 饶阳县| 海丰县| 远安县| 班戈县| 凯里市| 西林县| 定襄县| 河西区| 罗城| 富平县| 梧州市| 湖南省| 牡丹江市| 平度市| 阿克| 阿图什市| 青铜峡市| 石门县| 博客| 平潭县| 吐鲁番市| 独山县| 新源县| 昌乐县| 连城县| 河源市| 得荣县| 梁河县| 定结县| 渝中区|