-
Sub-task
-
Resolution: Delivered
-
P4
-
jfx24
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
```
```
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
```