Java bytecode decompiler in IntelliJIDEA for Scala

独自空忆成欢 提交于 2019-12-09 09:18:35

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/48020551/java-bytecode-decompiler-in-intellijidea-for-scala

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!