Is it possible to view bytecode of Class file?

Abhishek Jain picture Abhishek Jain · Jul 23, 2010 · Viewed 75.4k times · Source

Possible Duplicate:
Is there a java classfile / bytecode editor to edit instructions?

Java source code is compiled into bytecode, which is actually in the class file. Is it possible to view bytecode of a compiled class?

If it is possible, can it be edited?

Is there an eclipse plugin for that available?

Answer

Jesper picture Jesper · Jul 23, 2010

Yes. You can use the javap command that's included with the JDK to see the byte code of a class. For example:

javap -c com.mypackage.MyClass

There are several libraries and tools that help you to work with Java bytecode, for example ASM and Jasmin.