简体   繁体   English

用于Scala的IntelliJIDEA中的Java字节码反编译器

[英]Java bytecode decompiler in IntelliJIDEA for Scala

I'm using IntellijIDEA Ultimate Edition. 我正在使用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. 浏览从java源代码编译的.class文件很简单:我只需双击.class文件,IDEA就会对其进行反编译。

However, with .class files that were compiled from scala source code it's not working. 但是,使用从scala源代码编译的.class文件,它无法正常工作。 It seems that IDEA just referencing to the scala source file. 似乎IDEA只是引用了scala源文件。

I've noticed that IDEA behaves like that only with scala plugin installed. 我注意到IDEA的行为与仅安装了scala plugin行为相似。 It works fine without it. 没有它,它工作正常。 Is there a way to decompile using IDEA without switching off scala plugin ? 有没有办法在不关闭scala plugin情况下使用IDEA进行反编译?

Finally this feature was released in Intellij. 最后,此功能在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. 您可以将Scala代码反编译为Java,以查看如何使用Java翻译和实现某段代码。

  1. In the Project tool window, right-click a Scala class that you want to decompile. 在“项目”工具窗口中,右键单击要反编译的Scala类。
  2. From the context menu, select Decompile Scala to Java. 从上下文菜单中,选择“将Scala反编译为Java”。

IntelliJ IDEA converts code to Java and opens the converted file in the editor. IntelliJ IDEA将代码转换为Java并在编辑器中打开转换后的文件。

You can also open a Scala class in the editor and use its context menu for the conversion. 您还可以在编辑器中打开Scala类,并使用其上下文菜单进行转换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM