Are there any Java APIs to find out the JDK version a class file is compiled for? Of course there is the javap tool to find out the major version as mentioned in here. Howev
basszero's approach can be done via the UNIX command line, and the "od(1)" command:
% od -x HelloWorldJava.class |head -2
0000000 feca beba 0000 3100 dc00 0007 0102 2a00
0000020 6f63 2f6d 6e65 6564 6163 642f 6d65 2f6f
"feca beba" is the magic number. The "0000 3100" is 0x31, which represents J2SE 5.0.