2

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

Community
  • 1
  • 1
javaamtho
  • 382
  • 3
  • 7
  • 20

2 Answers2

4

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.

Edwin Buck
  • 69,361
  • 7
  • 100
  • 138
1

see here it having the solution

Community
  • 1
  • 1
Ishu
  • 12,797
  • 5
  • 35
  • 51
  • @javaamtho,you need to accept one ans if your prob has been sort out.just check the check mark at the right hand for answers. – Ishu Mar 09 '11 at 08:43