0 votes
1 view
in Java by (3k points)

How can I tell what version of the Java compiler was used to build a jar? I have a jar file, and it could have been built in any one of three JDKs. We need to know exactly which one, so we can certify compatibility. Is the compiler version embedded somewhere in the class files or jar?

1 Answer

0 votes
by (32.8k points)

You can't tell of the JAR file itself, certainly.

Download a hex editor and open one of the class lists inside the JAR and see at byte offsets 4 through 7. The version information is built in.

http://en.wikipedia.org/wiki/Java_class_file

those bytes tell you what version the class has been compiled FOR, not what version compiled it.

...