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

Bump minimum JDK version for JavaFX to JDK 24

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • jfx26
    • javafx
    • None
    • behavioral
    • low
    • Hide
      A JavaFX application that has a dependency on another library that runs on JDK 23, but fails to run on JDK 24, will be unable to update to JavaFX 26. As JDK 23 is already out of support, this is not likely to be a problem.
      Show
      A JavaFX application that has a dependency on another library that runs on JDK 23, but fails to run on JDK 24, will be unable to update to JavaFX 26. As JDK 23 is already out of support, this is not likely to be a problem.
    • Class file construct
    • JDK

      Summary

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

      Problem

      In order for JavaFX to be able to use more recent JDK features, we should 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 little reason to continue to do so.

      Solution

      Use javac --release 24 to generate the class files that make up the JavaFX modules, except for the javafx.swing module where we will use -source 24 -target 24. The javafx.swing module requires the jdk.unsupported.desktop module, which is excluded by --release NN. Using -source 24 -target 24 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 24. 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.

      Specification

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

      The following will be added to the JavaFX 26 release notes:

      ### JavaFX 26 Requires JDK 24 or Later
      
      JavaFX 26 is compiled with `--release 24` and thus requires JDK 24 or later in order to run.
      If you attempt to run with an older JDK, the Java launcher will exit with an error message
      indicating that the `javafx.base` module cannot be read.
      
      See JDK-8365402(https://bugs.openjdk.org/browse/JDK-8365402) for more information.

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Ambarish Rapte
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: