问题描述
我可以用什么程序来反编译类文件?我是否真的会获得Java代码,还是仅仅是JVM汇编代码?
关于本网站上的Java性能问题我经常看到那些反编译Java的人的回复类文件,看看编译器如何优化某些东西。
2016年2月更新:
,等) 。
它具有在线实际上功能齐全!你可以在页面上删除一个jar文件,看看反编译的源代码,而无需安装任何东西。
What program can I use to decompile a class file? Will I actually get Java code, or is it just JVM assembly code?
On Java performance questions on this site I often see responses from people who have "decompiled" the Java class file to see how the compiler optimizes certain things.
Update February 2016:
www.javadecompilers.com lists JAD as being:
So your mileage may vary with recent jdk (7, 8).
The same site list other tools.
And javadecompiler, as noted by Salvador Valencia in the comments (Sept 2017), offers a SaaS where you upload the .class
file to the cloud and it returns you the decompiled code.
Original answer: Oct. 2008
- The final release of JSR 176, defining the major features of J2SE 5.0 (Java SE 5), has been published on September 30, 2004.
- The lastest Java version supported by JAD, the famous Java decompiler written by Mr. Pavel Kouznetsov, is JDK 1.3.
- Most of the Java decompilers downloadable today from the Internet, such as "DJ Java Decompiler" or "Cavaj Java Decompiler", are powered by JAD: they can not display Java 5 sources.
Java Decompiler (Yet another Fast Java decompiler) has:
- Explicit support for decompiling and analyzing Java 5+ ".class" files.
- A nice GUI:
It works with compilers from JDK 1.1.8 up to JDK 1.7.0, and others (Jikes, JRockit, etc.).
It features an online live demo version that is actually fully functional! You can just drop a jar file on the page and see the decompiled source code without installing anything.
这篇关于我如何“反编译” Java类文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!