Tool to read and display Java .class versions
If I have a compiled Java class, is there a way to tell from just the cla
I've found this on the net and it works.
Every '.class' file starts off with the following:
- Magic Number [4 bytes]
- Version Information [4 bytes]
A hexdump of a '.class' file compiled with each of the following options reveals:
javac -target 1.1==>CA FE BA BE 00 03 00 2D
javac -target 1.2==>CA FE BA BE 00 00 00 2E
javac -target 1.3==>CA FE BA BE 00 00 00 2F
javac -target 1.4==>CA FE BA BE 00 00 00 30Perhaps you could use this information to write your own '.class' file version checking utility, using Java, or perhaps a scripting or shell language ;) !
I hope this helps.
Anthony Borla
From: http://bytes.com/groups/java/16603-how-determine-java-bytecode-version