This question already has an answer here:
I am working on a bytecode manipulation/generation in Java and I was just wondering if there is an easy way I could check the bytecode. I do not want to decompile the file, I would like to actually look at the compiled bytecode. I do not need to edit it. Any links or programs for doing this would be acceptable answers.
I've been working on a decompiler that has a color-coded bytecode output mode (which I find far more readable than javap). It can also output Java code or an intermediate 'bytecode AST'.
Since you wanted to be guided to some program that can easily show you the byte code then my suggestion is to use IntelliJ IDEA since it has built-in support for viewing byte code.
Here's an example how to do it (it can also be mapped to some keys of your choice):


It is very easy, and it can surely be done in eclipse or NetBeans as well.
The javap
command-line tool, which is bundled with Oracle's JDK, gives a detailed textual dump of .class files along with the constant pool and all functions' bytecode content. Just run it with -v
to get a full dump.
来源:https://stackoverflow.com/questions/16774744/is-it-possible-to-view-a-java-class-files-bytecode