Not so. What is recorded in the class file is the version of the class file - it is not the version of Java that was used to compile the program. You can't tell by looking at the class file what Java version was used for the compilation.
See http://forum.java.sun.com/thread.jspa?threadID=624398&messageID=3791498
> Not so. What is recorded in the class file is the
> version of the class file - it is not the version of
> Java that was used to compile the program. You can't
> tell by looking at the class file what Java version
> was used for the compilation.
well, at least it tells the lowest version of the JDK which "is used to compile the lib"
Message was edited by: S_i_m_u
or lowest version of VM to run it
> I tried a class compiled by 1.4 and a class compiled
> by 1.5.
> I got all zero:
>
>minor version: 0
> major version: 0
>
> I run javap which is a part of jdk1.4.2_12
> Anything wrong from my side?
>
> Thanks.
Yes. something is wrong. Just open the class file with something that can display hexidecimal data and look at bytes 5 - 8 in the file. They contain the minor:major versions in hex.