使用DEBUG的方式進(jìn)行調(diào)試
Eclipse版本4.7.2(隨便找了個(gè)最新版本)如下圖:
Eclipse啟動(dòng)截圖
1、菜單欄 Help -> Eclipse Marketplace ... -> Find 鍵入【decompiler】點(diǎn)擊搜索
搜索結(jié)果圖
安裝上圖紅框Enhanced Class Decompiler 3.0.0
安裝完成圖
2、調(diào)整Class文件默認(rèn)編輯器 Window -> Preferences -> General -> Editors -> File Associations
? ? 選擇 *.class -> Associated editors -> 類反編譯查看器 -> Default
Class文件設(shè)置
? ??選擇 *.class without source -> Associated editors -> 類反編譯查看器 -> Default
Class without source文件設(shè)置
? ? -> Apply and close
3训堆、調(diào)整反編譯器參數(shù)?Window -> Preferences -> Java -> 反編譯器 -> Apply? ?按下圖配置
反編譯器配置
4王滤、DEBUG測(cè)試硫狞,測(cè)試代碼如下:
測(cè)試代碼
? ? 點(diǎn)擊Ctrl+鼠標(biāo)左鍵 指向String 可進(jìn)入下圖产镐,在構(gòu)造函數(shù)打breakpoint
斷點(diǎn)位置
? ? DEBUG啟動(dòng)Main方法
斷點(diǎn)已經(jīng)成功打上