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
- Java 1.4 uses major version 48
- Java 5 uses major version 49
- Java 6 uses major version 50
- Java 7 uses major version 51
- Java 8 uses major version 52
- Java 9 uses major version 53
- Java 10 uses major version 54
- Java 11 uses major version 55
- Java 12 uses major version 56
- Java 13 uses major version 57
- Java 14 uses major version 58
- Java 15 uses major version 59
- Java 16 uses major version 60
- Java 17 uses major version 61
Where does this list come from? Is there a specific reference for this? Preferably something that shows minor versions too?
A Java class file is a file (with the .class filename extension) containing Java bytecode that can be executed on the Java Virtual Machine (JVM).
minor version 52.0, the class is compiled using JDK 8 since major version 52 corresponds to Java SE 8.
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.
There are four platforms of the Java programming language: Java Platform, Standard Edition (Java SE) Java Platform, Enterprise Edition (Java EE) Java Platform, Micro Edition (Java ME)
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 love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With