I saw this list of major version numbers for Java in another post:
- Java 1.2 uses major version 46
- Java 1.3 uses major version 47
If you have a class file at build/com/foo/Hello.class
, you can check what java version it is compiled at using the command:
javap -v build/com/foo/Hello.class | grep "major"
Example usage:
$ javap -v build/classes/java/main/org/aguibert/liberty/Book.class | grep major
major version: 57
According to the table in the OP, major version 57 means the class file was compiled to JDK 13 bytecode level
These come from the class version. If you try to load something compiled for java 6 in a java 5 runtime you'll get the error, incompatible class version, got 50, expected 49. Or something like that.
See here in byte offset 7 for more info.
Additional info can also be found here.
I found a list of Java class file versions on the Wikipedia page that describes the class file format:
http://en.wikipedia.org/wiki/Java_class_file#General_layout
Under byte offset 6 & 7, the versions are listed with which Java VM they correspond to.
If you're having some problem about "error compiler of class file", it's possible to resolve this by changing the project's JRE to its correspondent through Eclipse.
I did that and it worked.