打开IDEA设置 File | Settings | Tools | External Tools 填入内容 show byte code $JDKPath$\bin\javap.exe -c $FileNameWithoutExtension$.class $OutputPath$/$FileDirRelativeToSourcepath$ 保存后,编译想要查看字节码文件的类(即在target里能看到那个类) 右击,选择show byte code,即可在控制台查看字节码文件内容