Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Major.Minor version of Java class file

📅 2015-Jan-25 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

A Java class file holds the Java bytecode for a Java class that can be executed on a Java virtual machine (VM). Encoded at the beginning of a class file is a major and minor version number of the class file format that is used in it. This major.minor number indicates which Java VM can execute this class file. The class file format is typically changed with a new release of Java.

The mapping from Java version to the major number is as follows:

J2SE 8 = 52
J2SE 7 = 51
J2SE 6.0 = 50
J2SE 5.0 = 49
JDK 1.4 = 48
JDK 1.3 = 47
JDK 1.2 = 46
JDK 1.1 = 45

Reference: Wikipedia page on Java class file