Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java bytecode decompiler in IntelliJIDEA for Scala

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?

like image 496
Dmitry Kach Avatar asked Dec 29 '17 09:12

Dmitry Kach


1 Answers

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.

like image 97
Dmitry Kach Avatar answered Sep 28 '22 00:09

Dmitry Kach