If I open a .class file that was compiled from kot...
# intellij
m
If I open a .class file that was compiled from kotlin, IJ tries to decompile it as a kotlin, although
// Implementation of methods is not available
How do I disable that and use standard java decompiler/bytecode viewer? (the option `Show bytecode`is also disabled right now).
There is a "Show kotlin bytecode" tool in the kotlin plugin, but it almost always crashes (with various exceptions depending on provided options). Does this happen to you too?
a
When you open a .class file, you can invoke an action “Decompile to Java”, but there is no visible link/button to invoke it in the editor, currently. We’ll see if we can add such a link.
See also a related feature request for Kotlin decompiler: https://youtrack.jetbrains.com/issue/KTIJ-9004
There is a “Show kotlin bytecode” tool in the kotlin plugin, but it almost always crashes
This is a mostly internal tool that is supported on a best-effort basis, however if you see crashes, please report them to YouTrack with sample code to reproduce.
m
“Decompile to Java” is what I needed, thanks! When I use it the "Show bytecode" action is still disabled, but I can easily use some external tool.
As to reporting "Show kotlin bytecode", well, from my experience it crashes most of the time on not smallish files. Btw, does the `IR target`switch trigger compilation on IR backend, meaning that it uses old backend otherwise? I can't compare the results because with that checked it virtually always crashes.
you can invoke an action “Decompile to Java”, but there is no visible link/button to invoke it in the editor, currently. We’ll see if we can add such a link.
Should I file a ticket for that somewhere? Along with enabling the "Show bytecode" action as in java .class'es.
a
You can watch the issue https://youtrack.jetbrains.com/issue/MP-4238 about the decompiler. Yes, IR is disabled by default, please watch https://youtrack.jetbrains.com/issue/KTIJ-15764. For “Show bytecode” action there are https://youtrack.jetbrains.com/issue/KTIJ-2754, https://youtrack.jetbrains.com/issue/KTIJ-10526
👍 1