Kotlin Bytecode - How to analyze in IntelliJ IDEA?

CaseyB picture CaseyB · Feb 21, 2016 · Viewed 11.9k times · Source

I want to see the compiled bytecode so I can learn more about how it works under the cover. I'm using IntelliJ IDEA 15 but can't find a way to see the bytecode. What am I missing?

Answer

hotkey picture hotkey · Feb 21, 2016

IntelliJ IDEA comes with a bytecode viewing tool for Kotlin:

Tools → Kotlin icon Kotlin → Show Kotlin Bytecode

Also available through Ctrl / ⌘+Shift+A as Show Kotlin Bytecode action.

It's a great tool that can jump to the corresponding bytecode when you move around in the source file. And it updates the bytecode on the fly whenever the source changes.


Also, I'd like to recommend jclasslib Bytecode Viewer as an external tool for low-level class files analysis (such as inspecting constant pools). Now it is also available as an IntelliJ IDEA plugin.