I'm using IntellijIDEA Ultimate Edition. Browsing .class
files that compiled from java
source code is easy: I can just double-click on .class
file and IDEA will decompile it.
However, with .class
files that were compiled from scala
source code it's not working. It seems that IDEA just referencing to the scala
source file.
I've noticed that IDEA behaves like that only with scala plugin
installed. It works fine without it. Is there a way to decompile using IDEA without switching off scala plugin
?
Finally this feature was released in Intellij.
From official website:
You can decompile your Scala code to Java to see how a certain piece of code is translated and implemented in Java.
- In the Project tool window, right-click a Scala class that you want to decompile.
- From the context menu, select Decompile Scala to Java.
IntelliJ IDEA converts code to Java and opens the converted file in the editor.
You can also open a Scala class in the editor and use its context menu for the conversion.
来源:https://stackoverflow.com/questions/48020551/java-bytecode-decompiler-in-intellijidea-for-scala