-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Describe the bug
I'm raising this more in hope than expectation, because I know ...

Although GraalVM doesn't support AWT, Liberica NIK does, from about v23 on. But the Quarkus AWT extension still doesn't work, even on Liberica.
This is related to #30908 (where @Karm got the app working on Linux, but the attempt to get it working on mac was abandoned). It's also related to #48422.
I have, of course, experimented with various combinations of marking classes and packages as build time or run time, but I can't find an 'end' to the chain; every addition just drags more things into the wrong side. I assume @Karm wouldn't have any more luck than me, but maybe he will (after all, we can make it work on Linux).
Expected behavior
In principle, if the VM works with AWT, it should work with our AWT extension.
Actual behavior
Fatal error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: An object of type 'javax.swing.plaf.ColorUIResource' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.
How to Reproduce?
-
Patch the quarkus
AWTProcessor
to comment out the line which flags MacOS as unsupported (search forMacOS AWT integration is not ready in Quarkus
, or comment out lines 56-58. The statement is true for GraalVM, but not for Liberica NIK. Rebuild the extension. -
Switch to using Liberica NIK
sdk use java 25.r25-nik
-
Download an empty application from code.quarkus.io
-
Update the pom to include awt:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-awt</artifactId>
<version>999-SNAPSHOT</version>
</dependency>
- Build with
mvn package -Pnative
. The build will fail in the analysis step.
Output of uname -a
or ver
Darwin hcummins-mac 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041 arm64
Output of java -version
openjdk version "25" 2025-09-16 LTS OpenJDK Runtime Environment Liberica-NIK-25.0.0-1 (build 25+37-LTS) OpenJDK 64-Bit Server VM Liberica-NIK-25.0.0-1 (build 25+37-LTS, mixed mode, sharing)