原创

IDEA 使用Bytecode Viewer查看字节码文件

温馨提示:
本文最后更新于 2023年02月18日,已超过 612 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我

1. 安装Bytecode Viewer 插件

    打开idea——>点击File——>Settings——>点击Plugins——>搜索框输入Bytecode Viewer——>点击Browse repositories——>选择jclasslib Bytecode Viewer——>点击Install——>Apply——>OK——>重启idea



重启之后,在View 菜单下会有一个Show Bytecode With jclasslib 选项。



编写示例代码如下

public class StudyJol {
    public static void main(String[] args){
        Object o = new Object();
//        System.out.println(ClassLayout.parseInstance(o).toPrintable());
        synchronized (o){
            System.out.println(ClassLayout.parseInstance(o).toPrintable());
        }
    }
}

用Show Bytecode With jclasslib 查看如下


正文到此结束
本文目录