What is the use of minor version in a a java class file? Is it really used till now? https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html
-
I missed following point in the spec Oracle's Java Virtual Machine implementation in JDK release 1.0.2 supports class file format versions 45.0 through 45.3 inclusive. JDK releases 1.1.* support class file format versions in the range 45.0 through 45.65535 inclusive. For k ≥ 2, JDK release 1.k supports class file format versions in the range 45.0 through 44+k.0 inclusive." – nantitv Mar 18 '16 at 07:35
-
Basically Oracle JDK not planning to change minor version from java 1.2 onwards – nantitv Mar 18 '16 at 07:35
2 Answers
I missed following point in the spec
"Oracle's Java Virtual Machine implementation in JDK release 1.0.2 supports class file format versions 45.0 through 45.3 inclusive. JDK releases 1.1.* support class file format versions in the range 45.0 through 45.65535 inclusive. For k ≥ 2, JDK release 1.k supports class file format versions in the range 45.0 through 44+k.0 inclusive."

- 3,539
- 4
- 38
- 61
As of Java 11 JEP 12, "Preview Language and VM Features" is available. Classes using preview features have a minor_version number of 0xFFFF
.
A class file denotes that it depends on the preview VM features of Java SE $N by having a major_version item that corresponds to Java SE $N and a minor_version item that has all 16 bits set. For example, a class file that depends on the preview VM features of Java SE 13 would have version 57.65535
So, here the minor_version is used. I am not aware of any other usage of the minor_number, in all other cases it is 0x0000
(expect for the oldest Java versions, up to version 1.1, where the minor_version is set to 0x0003
).

- 12,062
- 4
- 64
- 92