如何将所有 .class 文件从 .jar 文件转换为 .java 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37726712/
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
How to convert all .class files into .java file from a .jar file
提问by Govind Gupta
I have a .jar file and When I extract it, It gives me all the .class files present in that jar file.
我有一个 .jar 文件,当我提取它时,它给了我该 jar 文件中存在的所有 .class 文件。
I have decompiled all the .class files using http://jd.benow.ca/tool but i want that all the .class files should save into .java files.
我已经使用http://jd.benow.ca/工具反编译了所有 .class 文件,但我希望所有 .class 文件都应该保存到 .java 文件中。
Right now i can see only the code but extension is not converting to .java.
现在我只能看到代码,但扩展名没有转换为 .java。
Anybody Please help me in this.
任何人请帮助我。
采纳答案by Hosseini
you can use javadecompilersand its works perfectly
您可以使用javadecompilers及其完美运行
and in the next step you decompile with Upload and Decompile
and this page be showing
在下一步中,您反编译Upload and Decompile
并显示此页面
and thats is just copy
the package
folder from the jarname.zip
and paste
it in you project.
并且那是刚刚copy
的package
从文件夹jarname.zip
和paste
它在你的项目。
i tested its work for me.
我为我测试了它的工作。
you can see this answerfor more.
您可以查看此答案以了解更多信息。
回答by JF Meier
jd-cmd
jd-cmd
https://github.com/kwart/jd-cmd
https://github.com/kwart/jd-cmd
works fine for decompiling. I used it to convert whole jars into source code. Look up the command line options for more details, e.g. --outputDir
for specifying a directory for the generated source code.
反编译工作正常。我用它来将整个 jars 转换为源代码。查看命令行选项以获取更多详细信息,例如--outputDir
为生成的源代码指定目录。