Skip to content

Commit

Permalink
[native-image] Adds -H:+ForeignAPISupport for all GraalVM 24.2+
Browse files Browse the repository at this point in the history
  • Loading branch information
Karm committed Oct 30, 2024
1 parent 8077229 commit eb483ad
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,16 @@ public NativeImageInvokerInfo build() {

addExperimentalVMOption(nativeImageArgs, "-H:+AllowFoldMethods");

/*
* Foreign Function and Memory API in Native Image, JDK's JEP 454
* This is needed for JDK 24+ internal native calls due to AWT,
* e.g. JDK-8337237 et al.
*
*/
if (graalVMVersion.compareTo(GraalVM.Version.VERSION_24_2_0) >= 0) {
addExperimentalVMOption(nativeImageArgs, "-H:+ForeignAPISupport");
}

if (nativeConfig.headless()) {
nativeImageArgs.add("-J-Djava.awt.headless=true");
}
Expand Down

0 comments on commit eb483ad

Please sign in to comment.