Skip to content

GraalVM for JDK 17 is not supported #2140

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

Closed
diegomarquezp opened this issue Apr 10, 2025 · 0 comments · Fixed by #2141 or #2144
Closed

GraalVM for JDK 17 is not supported #2140

diegomarquezp opened this issue Apr 10, 2025 · 0 comments · Fixed by #2141 or #2144
Assignees
Labels
type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@diegomarquezp
Copy link

diegomarquezp commented Apr 10, 2025

Context

While running our GraalVM native tests in our Spring Cloud GCP Cloud SQL MySQL sample, we found the following error due to a flag not supported in GraalVM for JDK 17.

Error: Could not find option 'UnlockExperimentalVMOptions' from 'jar:file:///home/runner/.m2/repository/com/google/cloud/sql/jdbc-socket-factory-core/1.23.1/jdbc-socket-factory-core-1.23.1.jar!/META-INF/native-image/com.google.cloud.sql/cloud-sql-jdbc-socket-factory-parent/native-image.properties'. Use -H:PrintFlags= to list all available options.

The problematic UnlockExperimentalVMOptions flag is used in the native-image.properties file of cloud-sql-jdbc-socket-factory.

The experimental options that are unlocked by the mentioned flag are:

  • -H:ReflectionConfigurationResources, declared as experimental
  • -H:ResourceConfigurationResources, declared as
  • -H:DynamicProxyConfigurationResources, declared as

The -H:UnlockExperimentalVMOptions flag was introduced in oracle/graal#7190 and was further modified in oracle/graal#7370.

Possible solution: removing the experimental flag

However, while wondering if removing this flag would have any effect on GraalVM 17, 21, 23, I raised cloud-sql-jdbc-socket-factory#2139 as a tentative solution.

Running the test locally with the following dependency:

Ended up with the following results for MODULE_UNDER_TEST=sql-mysql-sample bash .github/workflows/scripts/native-image-tests.sh:

GraalVM for JDK
Result
17.0.9-graalce Success
21.0.2-graalce Success (with warnings on the experimental flags)
23.0.2-graalce Success (with warnings on the experimental flags)
23.0.2-graalce with NATIVE_IMAGE_EXPERIMENTAL_OPTIONS_ARE_FATAL=true Failure due to flags not being explicitly unlocked

See also

@diegomarquezp diegomarquezp added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Apr 10, 2025
hessjcg added a commit that referenced this issue Apr 10, 2025
The GraalVM flag UnlockExperimentalVMOptions is not supported
in GrallVM 17.0, and is not required in 21.0 or 23.0. Removing
the flag restores compatibility with GraalVM 17.

Fixes #2140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
2 participants