"Samuel Jackson" <sa**********@hotmail.com> wrote in message
news:22**************************@posting.google.c om...
Howdy,
I'm trying to figure out what bytecode version a given class was
compiled with. I've tried looking at the actual .class file, but that
didn't pan out.
Is there a utility to determine versions?
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 30
Perhaps 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
P.S.
If requiring more information just do a Google search for ".class file
format" or "Java Bytecode Tutorial"