Possible Duplicate:
how to check the jdk version used to compile a .class file
Hello,
I have lots of third party class files and i would like to know . with which java version, those class files were compiled ..
thanks in advance javaamtho
Possible Duplicate:
how to check the jdk version used to compile a .class file
Hello,
I have lots of third party class files and i would like to know . with which java version, those class files were compiled ..
thanks in advance javaamtho
You can't really check what version of the compiler generated the class file. Java support compiling to a "Target" which might be less than the actual version of the compiler. This means that if you call javac in a JDK 1.6 release with the flag "-target 1.5" the 1.6 JDK will generate 1.5 class files.
However, you can check the mimimum JRE version the class requires. It's written as the "major number" in the class. This "major number" occupies the 7th and 8th byte of a class file. Look to the specification for more details.
48, 49, and 50 correspond to JRE 1.4, 1.5, and 1.6 respectively.