JDK-8191510 : Bump class file version number to 54.0
  • Type: CSR
  • Component: core-libs
  • Priority: P2
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 10
  • Submitted: 2017-11-17
  • Updated: 2018-01-11
  • Resolved: 2017-12-05
Related Reports
CSR :  
Relates :  
Sub Tasks
JDK-8193662 :  
Description
Summary
-------

Increment the class file major version number from 53 to 54 (10 - 5 + 49)


Problem
-------

For every major release the class file major version number should be incremented (regardless of if there are any changes that mandate such a change).
(It's debatable whether future platform releases require a CSR for such changes but at least for the first time the CSR affords visibility into the new release process.)

Solution
--------

The platform will be modified so tools such as the Java compiler and launcher will consume and produce 54 version class files.

The lower bound (6) for the `source`, `release`, and `target` options of `javac` will not change.  

Specification
-------------

Per JDK-8190736, the JVM Specification (Java SE 18.3 Edition, see http://ribbit.us.oracle.com/tmp/iris/java-se-18.3-pr-spec/java-se-18.3-annex-3.html) establishes the 54.0 class file format in section 4.1 as follows:

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.
The range is based on the version of the Java SE Platform to which the
implementation conforms. An implementation which conforms to a given Java
SE Platform version must support the range specified in Table 4.1-A for that
version, and no other range. (For historical cases, the JDK version is shown
instead of the Java SE Platform version.)

    Table 4.1-A. class file format version ranges (by Java SE Platform)
    Java SE class file format version range
    1.0.2 45.0 ��� v ��� 45.3
    1.1 45.0 ��� v ��� 45.65535
    1.2 45.0 ��� v ��� 46.0
    1.3 45.0 ��� v ��� 47.0
    1.4 45.0 ��� v ��� 48.0
    5.0 45.0 ��� v ��� 49.0
    6 45.0 ��� v ��� 50.0
    7 45.0 ��� v ��� 51.0
    8 45.0 ��� v ��� 52.0
    9 45.0 ��� v ��� 53.0
    18.3 45.0 ��� v ��� 54.0
Comments
Moving to approved subject to "18.3" being replaced by "10" in the table. I've added a link to JDK-8028546 in the main bug.
05-12-2017

I would like to suggest that we separate out the version bump for 11 from any change of the interval for the source/target/release for 11, which could be identified as a separate issue + CSR. Specifically the version bump itself can, going forward, be something with minimal process, that occurs almost immediately after a release branches off the mainline.
30-11-2017

Surprisingly, major_version and minor_version are not in the index of the JVMS. The spec does note: https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.1 "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. " However, there are other uses of major_version in the text, but they may be phrased in a way that doesn't require updating.
20-11-2017