We java developers at our workplace frequently use various decompilers to view source code of compiled java classes. Did you know that a powerful tool comes along with JDK which can disassemble a class file?

Yes, javap tool disassembles a class file. It prints fields and methods on console. If java is installed in your machine, try executing following command:
javap HelloWorld
(Make sure that HelloWorld.class is available in class path)

Above command will not attempt to display method content. To see disassembled method code use option -c:
javap -c HelloWorld

To see other available options execute following command:
javap -help

For more details, please click here.

Share Button