Skip to content

Commit 42d7a13

Browse files
committed
[native-image] Adds -H:+ForeignAPISupport for all GraalVM 24.2+
1 parent d085393 commit 42d7a13

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,16 @@ public NativeImageInvokerInfo build() {
834834

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

837+
/*
838+
* Foreign Function and Memory API in Native Image, JDK's JEP 454
839+
* This is needed for JDK 24+ internal native calls due to AWT,
840+
* e.g. JDK-8337237 et al.
841+
*
842+
*/
843+
if (graalVMVersion.compareTo(GraalVM.Version.VERSION_24_2_0) >= 0) {
844+
addExperimentalVMOption(nativeImageArgs, "-H:+ForeignAPISupport");
845+
}
846+
837847
if (nativeConfig.headless()) {
838848
nativeImageArgs.add("-J-Djava.awt.headless=true");
839849
}

0 commit comments

Comments
 (0)