JDK-8210790 : Release Note: Swing interop fails when using a minimal jdk image created with jlink
  • Type: Sub-task
  • Component: javafx
  • Sub-Component: swing
  • Affected Version: openjfx11
  • Priority: P3
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2018-09-15
  • Updated: 2018-10-01
  • Resolved: 2018-10-01
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
openjfx11Resolved
Description
A minimal Java image created using jlink that includes the javafx.swing module from the JavaFX 11 jmods bundle will fail to run FX / Swing interop applications. For example, an image created as follows will not work:

```
    jlink --output myjdk --module-path javafx-jmods-11 \
        --add-modules java.desktop,javafx.swing,javafx.controls
```

The javafx.swing module depends on a new jdk.unsupported.desktop module in JDK 11 that must either be explicitly added or included via the `--bind-services` option.

Workaround: create your image using one of the following two methods:

```
    jlink --output myjdk --module-path javafx-jmods-11 \
        --add-modules java.desktop,javafx.swing,javafx.controls,jdk.unsupported.desktop

    jlink --output myjdk --bind-services --module-path javafx-jmods-11 \
        --add-modules java.desktop,javafx.swing,javafx.controls
```