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:
http://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
.classfile 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.