Is it possible to view a Java class files bytecode [duplicate]

眉间皱痕 提交于 2019-11-29 01:25:15

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.

Not sure what exactly you need, but apart from javap, which is a command-line tool for displaying the bytecode, you can take a look at javassist, asm and cglib - they allow you to parse the bytecode with java code.

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!