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 24, 2024
1 parent 8f7119e commit 8c18d75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion integration-tests/awt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skip>true</skip>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
Expand Down

0 comments on commit 8c18d75

Please sign in to comment.