Java bytecode decompiler in IntelliJIDEA for Scala

Dmitry Kach :

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?

Dmitry Kach :

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.

  1. In the Project tool window, right-click a Scala class that you want to decompile.
  2. 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.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=438114&siteId=1