8

This is actually not about decompiling, I don't want to see the source, instead I want to see JVM instructions like invoke some/package/method()V.

Is there a tool for this purpose?

Ricardo Cristian Ramirez
  • 1,194
  • 3
  • 20
  • 42

3 Answers3

5

suppose you have a class file named MyClass.class

you can easily see what JVM instructions constitute your classfile by using a program shipped by jdk itself,in the same bin directory where java and javac exist.

 javap -c MyClass.class

The above command will provide you with what you be be looking for.

Abhishek
  • 438
  • 1
  • 6
  • 16
  • 1
    THIS is the best answer, as long as using internal JDK things is much more elegant, than anything else, since the question do not specify IDE involved. – user2501323 Jul 05 '21 at 14:36
3

I am using Eclipse + Bytecode Outline plugin for Eclipse http://andrei.gmxhome.de/bytecode/index.html. THis is how bytecode looks like

  public static main([Ljava/lang/String;)V throws java/io/IOException 
   L0
    LINENUMBER 11 L0
    INVOKESTATIC test/Test.x ()V
   L1
    LINENUMBER 12 L1
    RETURN
...
Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275
2

Try that: http://set.ee/jbe/

This tool allows you to see opcodes, attributes and edit it. It's really useful, but doesn't work with Java 8 lambdas.

Kamil Jarosz
  • 2,168
  • 2
  • 19
  • 30