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 29, 2024
1 parent 8077229 commit 27b8eb7
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,15 @@ 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.
* TODO: Do we enable it globally like so or do we only enable it when AWT extension is used?
*/
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 27b8eb7

Please sign in to comment.