How do I "decompile" Java class files?
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:
the most popular Java decompiler, but primarily of this age only. Written in C++, so very fast.
Outdated, unsupported and does not decompile correctly Java 5 and later
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
Java Decompiler (Yet another Fast Java decompiler) has:
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.
There are a few decompilers out there... A quick search yields:
And many more.
These produce Java code. Java comes with something that lets you see JVM byte code (javap).
To see Java source code check some decompiler. Go search for jad .
If you want to see bytecodes, just use javap which comes with the JDK.
链接地址: http://www.djcxy.com/p/15188.html下一篇: 如何“反编译”Java类文件?