JEP 12: JVM version constraints
daniel.smith at oracle.com
Mon Mar 5 22:57:01 UTC 2018
JEP 12, in describing the treatment of "preview" class files, requires that:
> A JVM implementation for Java SE $N must not define a class file that depends on the preview VM features of another platform version
In other words, where SE 11 class files have major version 55, an SE 12 JVM must reject class files with version 55.65535.
This is a change in JVM behavior—currently the spec says:
"A Java Virtual Machine implementation can support a class file format of version v if and only if v lies in some contiguous range Mi.0 ≤ v ≤ Mj.m." (JVMS 4.1)
Note the word "contiguous".
Where is this change being tracked? Since it's not, itself, part of a preview feature, it could easily be overlooked.
My two cents: we can carve out a really narrow range of prohibited version numbers (55.65535, 56.65535, ...). But I'd rather make a breaking change: enumerate all the actually-used version numbers since 1.0 (something like 45.*, 46.0, 47.0, ..., 55.0), and reject the rest.
More information about the jdk-dev