Fernflower 和 IntelliJ IDEA 的 java 反编译器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39864346/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 04:42:49  来源:igfitidea点击:

Fernflower and IntelliJ IDEA's java-decompiler

javaintellij-ideadecompiler

提问by Tianxiang Xiong

I'm trying to figure out how to use the FernflowerJava decompiler.

我想弄清楚如何使用FernflowerJava 反编译器。

I can find java-decompiler.jarat the following location:

我可以java-decompiler.jar在以下位置找到:

~/idea-IC-162.1628.40/plugins/java-decompiler/lib/java-decompiler.jar

There is no fernflower.jar, however. I assume this is because the functionality has been folded into java-compiler.jar, and the Fernflower README has simply not been updated in 2 years.

fernflower.jar然而,没有。我认为这是因为功能已被折叠到java-compiler.jar.

When I run the following, however:

但是,当我运行以下命令时:

java -jar ~/idea-IC-162.1628.40/plugins/java-decompiler/lib/java-decompiler.jar myclassfile.class .

I get

我得到

no main manifest attribute, in /home//idea-IC-162.1628.40/plugins/java-decompiler/lib/java-decompiler.jar

没有主要清单属性,在 /home//idea-IC-162.1628.40/plugins/java-decompiler/lib/java-decompiler.jar

Has IntelliJ stopped supporting command-line based decompilation, or am I missing something here?

IntelliJ 是否停止支持基于命令行的反编译,或者我在这里遗漏了什么?

回答by popalka

Try to invoke main class org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompilermanually

尝试org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler手动调用主类

java -cp java-decompiler.jar org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler myclassfile.class .

Also you can find more about internal usage of Fernflower inside IDEA by query in source code https://github.com/JetBrains/intellij-community/search?utf8=%E2%9C%93&q=Fernflower

您也可以通过在源代码中查询 https://github.com/JetBrains/intellij-community/search?utf8=%E2%9C%93&q=Fernflower