JDK-8347745 : Release Note: JavaFX Applications Must Use `--enable-native-access`
  • Type: Sub-task
  • Component: javafx
  • Sub-Component: other
  • Affected Version: jfx24
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2025-01-14
  • Updated: 2025-10-07
  • Resolved: 2025-09-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx24Resolved
Description
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
```

Comments
"JDK 24 with JavaFX 24" Does it have anything to do with FX 24 specifically ? Isn't it just "running a JavaFX application on JDK24" ? "avoid the warning now" -> suppress the warning now
14-01-2025