Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8291052

Bump minimum JDK version for JavaFX to JDK 17

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • jfx20
    • javafx
    • None
    • behavioral
    • medium
    • A JavaFX application that has a dependency on another library that runs on JDK 11, but fails to run on JDK 17, will be unable to update to JavaFX 20.
    • Class file construct
    • JDK

      Summary

      Update the minimum version needed to run JavaFX to JDK 17.

      Problem

      In order for JavaFX to be able to use newer JDK features, such as records, switch expressions, text blocks, and so forth, we need to increase the minimum version of the JDK that can run the latest JavaFX. Additionally, there is an ongoing cost to keeping JavaFX buildable and runnable on older versions of Java, and very little reason to continue to do so.

      Solution

      Use javac --release 17 to generate the class files that make up the JavaFX modules, except for the javafx.swing module where we will use -source 17 -target 17. The javafx.swing module requires the jdk.unsupported.desktop module, which is excluded by --release NN. Using -source 17 -target 17 is functionally equivalent, although it doesn't provide protection against accidentally using APIs that are present in the boot JDK with which we build JavaFX, but are unavailable in JDK 17. Care must be taken not to introduce a dependency on a too-new API by the javafx.swing module. As that module is unlikely to evolve, this is not much of a concern. This is a significant improvement over the current situation where we use -source 11 -target 11 for all modules, not just javafx.swing.

      Specification

      The class files in all JavaFX modules will be version 61.0 class files, meaning that they will only run on JDK 17 or newer.

      The following diffs will be applied to the JavaFX 20 release notes:

      -As of JDK 11 the JavaFX modules are delivered separately from the JDK.
      -These release notes cover the standalone JavaFX 19 release. JavaFX 19 requires JDK 11 or later.
      +These release notes cover the standalone JavaFX 20 release. JavaFX 20 requires JDK 17 or later.

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: