1

I use Intellij community 2018 on Ubuntu. How can I have a jdk option in the menu that appears after right clicking inside the editor window?

I don't know if this option is built into the IDE or some external plugin.

This jdk option should have (at least) 2 javap options to disassemble class files. See the following screen shot. Taken from an older Intellij on Mac.

enter image description here

rapt
  • 11,810
  • 35
  • 103
  • 145

1 Answers1

0

You can configure an external tool to run javap on the active file using the $FilePath$ macro as an argument. Set the tool group to jdk.

If you want to get the output for the .class file while right clicking inside the source .java file, you may use something like this for the argument: $OutputPath$/$FileDirRelativeToSourcepath$/$FileNameWithoutExtension$.class

Note that IntelliJ IDEA has a built-in disassembler and some third-party plug-ins to view the byte code, so you may not need this tool at all.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • Thanks! Built in disassembler? How to access it? Is it different in its capabilities from the bytecode plugins? I installed the `ASM Bytecode Viewer` plugin version 6.0.1 with a bytecode tab and ASM code tab... but it does not show a constant table like I see when I run `javap -verbose` from the terminal. You can see what I mean in this tutorial: https://vimeo.com/52990474 time: 11:40 – rapt Feb 12 '19 at 08:37
  • You can click on a `.class` file in IntelliJ IDEA and it will open the disassembled source code. There is also a built-in `View` | `Show Byte Code` action, but it doesn't show the Constant pool like `javap`. – CrazyCoder Feb 12 '19 at 08:40
  • @rapt did my answer help to get the javap external tool working? – CrazyCoder Feb 27 '19 at 11:29
  • I apologize, I did not have time to test it. I will definitely check and let you know. In the meanwhile, thanks for replying. – rapt Mar 29 '19 at 02:14