问题描述
我正在使用IntellijIDEA Ultimate Edition.浏览从java
源代码编译的.class
文件很容易:我可以双击.class
文件,IDEA会反编译它.
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.
但是,对于从scala
源代码编译的.class
文件,它不起作用.似乎IDEA只是引用scala
源文件.
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.
我注意到IDEA的行为仅与安装scala plugin
的行为类似.没有它就可以正常工作.有没有一种方法可以在不关闭scala plugin
的情况下使用IDEA进行反编译?
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
?
推荐答案
最后,此功能已在Intellij中发布.
Finally this feature was released in Intellij.
来自官方网站:
- 在项目"工具窗口中,右键单击要反编译的Scala类.
- 从上下文菜单中,选择将Scala反编译为Java".
IntelliJ IDEA将代码转换为Java,并在编辑器中打开转换后的文件.
IntelliJ IDEA converts code to Java and opens the converted file in the editor.
您还可以在编辑器中打开Scala类,并使用其上下文菜单进行转换.
You can also open a Scala class in the editor and use its context menu for the conversion.
这篇关于IntelliJIDEA for Scala中的Java字节码反编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!