简体   繁体   English

如何将.class文件转换为.jar文件中的.java文件

[英]How to convert all .class files into .java file from a .jar file

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. 任何人请帮助我。

you can use javadecompilers and 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. 那只是从jarname.zip copy package文件夹pastepaste到您的项目中。

i tested its work for me . 为我测试了它的工作

在此输入图像描述

you can see this answer for more. 你可以看到这个答案更多。

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, eg --outputDir for specifying a directory for the generated source code. 查找命令行选项以获取更多详细信息,例如--outputDir用于指定生成的源代码的目录。

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

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