Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temurin 17 JRE builds are missing modules (jdk.unsupported.desktop, jdk.random) #2883

Open
anctilg opened this issue Mar 28, 2022 · 5 comments
Labels
windows Issues that affect or relate to the WINDOWS OS

Comments

@anctilg
Copy link

anctilg commented Mar 28, 2022

What are you trying to do?
Using JavaFX 17's swing integration, which is using the jdk.unsupported.desktop in conjunction with OpenJDK17U-jre_x64_windows_hotspot_17.0.2_8

Expected behaviour:
The module is available and the application that uses Java FX 17's swing integration with the JRE build does not crash. It should work just fine, just like it does on the JDK build (OpenJDK17U-jdk_x64_windows_hotspot_17.0.2_8)

Observed behaviour:
The module is not available in the modules file of the build, and an application that makes use of jdk.unsupported.desktop crashes when using the JRE build, while it does not when using the JDK build.

Any other comments:
Both the OpenJDK17U-jdk_x64_windows_hotspot_17.0.2_8 & OpenJDK17U-jre_x64_windows_hotspot_17.0.2_8 builds have a "release" file at the root of the JDK/JRE folder. Both files are identical except for the IMAGE_TYPE line.

So both release files indicate the jdk.random and jdk.unsupported.desktop modules as available on the MODULES line.

If you run jimage list ..\lib\modules on both builds and compare the output, you can clearly see that the list differs from the list in the "release" file on the JRE build. The JRE build is missing a few modules that are of limited use on a JRE, which is fine, but both jdk.random and jdk.unsupported.desktop should be included and they are not.

I see two issues here:

  1. the "release" file that lies about the contents of the release on the MODULES line
  2. The missing inclusion of both jdk.random and jdk.unsupproted.desktop modules in the JRE builds.

Related to this is this bug for jdk.random on ALPINE: #2843

@github-actions github-actions bot added the windows Issues that affect or relate to the WINDOWS OS label Mar 28, 2022
@anctilg
Copy link
Author

anctilg commented Mar 28, 2022

Additional information:

The Azul Zulu JRE build zulu17.32.13-ca-jre17.0.2-win_x64 contains jdk.random in its modules file, but not desktop.unsupported. Their "release" file does not contain the jdk.unsupported.desktop module in their MODULES line.

They do provide a JRE + JavaFX build, but that build does not include the javafx.swing module, and does not include the jdk.unsupported.desktop module either (which would be required by javafx.swing)

@jensli
Copy link

jensli commented Jun 20, 2023

Work-around: It is easy to use jlink to build a custom JRE from a Temurin JDK.

jdk-17.0.7+7/bin/jlink --strip-debug --compress=2 --output=custom-jre --add-modules=java.se,jdk.unsupported.desktop,jdk.unsupported,jdk.random

If you try to start your application and get the following errors you can add more modules:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module jdk.jsobject not found, required by javafx.web

See this for more: https://adoptium.net/blog/2021/10/jlink-to-produce-own-runtime/

@karianna
Copy link
Contributor

I suspect this is because we defaulted to using the same modules as the legacyJre target.

@hendrikebbers Are you able to comment here?

@rkraneis
Copy link

This is still an issue with at least eclipse-temurin:21-jre-ubi9-minimal.

@jensli
Copy link

jensli commented May 31, 2024

Any news here? It's a real disadvantage not to be able to use Temurin to run JavaFX applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
windows Issues that affect or relate to the WINDOWS OS
Projects
Status: Todo
Development

No branches or pull requests

4 participants