IDEA安装class文件分析工具(binEd 和 JClassLib)
1.JClassLib 可以觀察ByteCode方法
打開IDEA的setting窗口,選擇Plugins,打開Browse repositories
?
image.png
?
搜索選擇安裝之后重啟Idea就好了。
?
image.png
2.JClassLib使用
新建一個Test類
public class Test { public static void main(String[] args) { int a = 1; int b = 2; a++; b--; int c = a + b; System.out.println(c); } }
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | public class Test { ????public static void main(String[] args) { ? ????????int a = 1; ????????int b = 2; ????????a++; ????????b--; ????????int c = a + b; ????????System.out.println(c); ? ????} } ? |
編譯好后,點擊show bytecode,可以看到完整的字節碼信息
當然,也可以點擊 Show ByteCode with Jclasslib,這時可以看到該類的基本信息、常量池、接口、屬性、函數等信息。
另外,如果想了解某個具體字節碼指令的含義,可以點擊它,就會跳轉到 java虛擬機規范對應的章節。
假設咱們想看iconst_1,點擊它
更細節的功能,大家自行挖掘吧
?
?
3.binEd 可以用二進制編碼或者16進制編碼查看文件
安裝方式如上
?
image.png
4.binEd 使用
image.png
?
在彈出窗口選擇要打開的文件
?
不積跬步,無以至千里
總結
以上是生活随笔為你收集整理的IDEA安装class文件分析工具(binEd 和 JClassLib)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: AAAIT学院JDK15新特性历史
- 下一篇: JAVA15.JDK15新特性.4 Te