1、使用 javap 命令查看字節碼
命令格式如下:
javap -c xxx.class
2、Intellij IDEA 中查看字節碼
View -> Show bytecode
3、Eclipse 中查看字節碼
在 Eclipse 中查看字節碼稍顯麻煩,需要安裝插件,並打開插件窗口,安裝和使用方式如下:
Name: bytecode
Location: http://andrei.gmxhome.de/eclipse
安裝完后需要重啟 Eclipse 才能生效。
Eclipse 打開 ByteCode
插件窗口:
Window-> Show View -> Other -> Java -> Bytecode