-
Sub-task
-
Resolution: Delivered
-
P4
-
jfx24
The `jdk.jsobject` module, which is used by JavaFX WebView applications, is now included with JavaFX, replacing the JDK module of the same name. The `jdk.jsobject` module is deprecated as of JDK 24, and will be removed in a future release of the JDK.
To facilitate the transition, `jdk.jsobject` is now an upgradable module in the JDK. This means that the version of `jdk.jsobject` delivered with JavaFX can be used in place of the one in the JDK to avoid the compiler warning. This can be done as follows:
#### Applications using the SDK
When running with the JavaFX SDK, use the `--upgrade-module-path` argument. For example:
```
javac --upgrade-module-path=/path/to/javafx-sdk-24/lib
java --upgrade-module-path=/path/to/javafx-sdk-24/lib
```
NOTE: The above will fail if you run your application with JDK 23 or earlier. JDK 24 is recommended when running JavaFX 24, but if you choose to run JavaFX 24 with an earlier JDK, use the `--module-path` option instead.
#### Applications using `jlink` to create a custom Java runtime image:
When creating your custom Java runtime image, put the JavaFX jmods on the module path ahead of the JDK jmoods. For example:
```
jlink --output jdk-with-javafx \
--module-path /path/to/javafx-jmods-24:/path/to/jdk-24/jmods \
--add-modules ALL-MODULE-PATH
```
NOTE: The above will fail if you create a custom image using JDK 23 or earlier. JDK 24 is recommended with JavaFX 24, but if you choose to run JavaFX 24 with an earlier JDK, put the JDK jmods ahead of the JavaFX jmods on the module path (that is, reverse the order of `javafx-jmods-24` and `jdk-24/jmods`).
To facilitate the transition, `jdk.jsobject` is now an upgradable module in the JDK. This means that the version of `jdk.jsobject` delivered with JavaFX can be used in place of the one in the JDK to avoid the compiler warning. This can be done as follows:
#### Applications using the SDK
When running with the JavaFX SDK, use the `--upgrade-module-path` argument. For example:
```
javac --upgrade-module-path=/path/to/javafx-sdk-24/lib
java --upgrade-module-path=/path/to/javafx-sdk-24/lib
```
NOTE: The above will fail if you run your application with JDK 23 or earlier. JDK 24 is recommended when running JavaFX 24, but if you choose to run JavaFX 24 with an earlier JDK, use the `--module-path` option instead.
#### Applications using `jlink` to create a custom Java runtime image:
When creating your custom Java runtime image, put the JavaFX jmods on the module path ahead of the JDK jmoods. For example:
```
jlink --output jdk-with-javafx \
--module-path /path/to/javafx-jmods-24:/path/to/jdk-24/jmods \
--add-modules ALL-MODULE-PATH
```
NOTE: The above will fail if you create a custom image using JDK 23 or earlier. JDK 24 is recommended with JavaFX 24, but if you choose to run JavaFX 24 with an earlier JDK, put the JDK jmods ahead of the JavaFX jmods on the module path (that is, reverse the order of `javafx-jmods-24` and `jdk-24/jmods`).
- relates to
-
JDK-8342625 Release Note: The `jdk.jsobject` Module Is Deprecated for Removal
-
- Resolved
-