• Post Reply Bookmark Topic Watch Topic
  • New Topic

View ByteCode  RSS feed

 
John Brendan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I want to view contents of ByteCode. I used Notepadd++ to view it but it displays as nonsense. Is it possible to view .class content?

Cheers
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can disassemble a .class file with the javap tool that ships with the JDK.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Brendan wrote:I want to view contents of ByteCode...

Is this just for intellectual curiosity, or something else?

If it's "something else", then beware. Different JVMs don't necessarily produce the same bytecode; and the same JVM may produce different code for different releases. So never do anything that relies on the bytecode being written a certain way.

HIH

Winston
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!