本文为博主原创,未经允许不得转载:

  jdk 的 bin 目录下存在 javap.exe 的工具,可通过 以下命令查看编译的字节码文件:

javap -c Test.class

  在 idea 中添加查看字节码文件的工具。主要就是通过设置 jdk 的 bin 目录下的javap.exe 进行查看,操作步骤如下:

  1.  打开settins 选择 Tools 再选择 External Tools ,点击左上角的 + 号:

  2. 设置Name :show simple byte codes

   设置Program 为jdk bin目录下的javap.exe

   设置Arguments表示参数: 

-c $FileNameWithoutExtension$.class

   设置 working directory :

$OutputPath$\$FileDirRelativeToSourcepath$

  具体设置如下图所示:

idea 中添加查看字节码工具

 

 

 

3.完成2以上的设置点击应用之后,在对应的类中右键---〉External tools -> show simple byte codes 便可进行查看:

idea 中添加查看字节码工具

 

相关文章:

  • 2021-08-05
  • 2021-08-13
  • 2022-01-06
  • 2022-01-02
  • 2021-11-02
  • 2021-09-18
  • 2021-08-15
  • 2021-07-10
猜你喜欢
  • 2022-02-07
  • 2021-10-29
  • 2021-04-26
  • 2022-12-23
  • 2021-06-29
  • 2022-01-03
相关资源
相似解决方案