aspose file tools*
The moose likes Java in General and the fly likes Class File Information Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Class File Information" Watch "Class File Information" New topic
Author

Class File Information

Saurav Chetia
Greenhorn

Joined: Oct 28, 2002
Posts: 10
If I have a java class file and I want to know about it's version(major and minor) how to obtain those values ?
I used com.ibm.toad.cfparse package. Using the ClassFile class I tried to get the major and minor versions but I get the default values of MajorVersion : 45 , and MinorVersion : 3.
I used the ClassFile constructor with InputStream argument.
Can someone tell me what am I am I missing here ?
Or else please suggest some other technique to get those information.
Thanks
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Saurav,
See if this doesn't work:

Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Saurav Chetia
Greenhorn

Joined: Oct 28, 2002
Posts: 10
Thanks Michael!
That was a simple method to obtain information from a class file.
I just had doubt related with JVM implementation of JDK versions and the Class file format supported. Got the information from the Sun's JVM Specification.
Thanks again
-Saurav
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Class File Information