Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8347744 JavaFX applications must use `--enable-native-access`
  3. JDK-8347745

Release Note: JavaFX Applications Must Use `--enable-native-access`

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • jfx24
    • jfx24
    • javafx

      Running a JavaFX application on JDK 24 will produce a warning from each of the three JavaFX modules that rely on native access, due to the changes specified in [JEP 472](https://openjdk.org/jeps/472). Each warning will include the following message:

      ```
      WARNING: Restricted methods will be blocked in a future release unless native access is enabled
      ```

      In order to suppress the warning now, and to be able to run your application at all in a subsequent version of the JDK, you need to explicitly enable native access for all modules that need it. This is done by passing `--enable-native-access=<list-of-modules>` to `java` on the command line, listing the modules that you grant native access. This list of modules includes `javafx.graphics` and, optionally, `javafx.media` and `javafx.web`, if your application uses those modules.

      For example:

      ```
      java --enable-native-access=javafx.graphics,javafx.media,javafx.web
      ```

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: