Closed wssy001 closed 6 months ago
22.3.1 did not support JDK 20, and AWT internals might have changed from JDK 17/19 to JDK 20. Have you tried regenerating reachability metadata using the tracing agent?
22.3.1 did not support JDK 20, and AWT internals might have changed from JDK 17/19 to JDK 20. Have you tried regenerating reachability metadata using the tracing agent?
@fniephaus
1: I know 22.3.1 not support JDK 20. What I want to say is that the same Java code can run in GraalVM version 22.3.1 well
2: I do use the tracing agent
and collect a file named jni-config.json
. that`s why I can use AWT for 2D drawing in old GraalVM version
Not sure what is the status of this fairly old issue, but I can reproduce this issue on my Ubuntu 22.04 x64 box, using the latest community versions of GraalVM for JDK 17
& GraalVM for JDK 21
, with the java.lang.Error: java.home property not set
message output. I use the awt-test project provided by the OP, but with some simplification to remove the Spring framework from it, and the issue is clearly reproducible with pure AWT code (without Spring) for both GraalVM versions. If needed, I can upload my simplified project to GitHub for perusal.
An interesting solution is that if I use the Liberica Native Image Kit to compile the native image of my project, then the resultant executable will work properly, for both JDK 17 & JDK 21 versions of the NIKs. I'm not sure what the differences are in the NIK as compared to the stock GraalVM CE version.
Describe the issue
When I use GraalVM 22.3.1, I can use AWT for 2D drawing, but after I upgrade to GraalVM 23.0.01, I can't do it
Steps to reproduce the issue Please include both build steps as well as run steps
the test project is here
run
mvn clean native:compile -Pnative -Dmaven.test.skip=true
to build a native imagerun
./target/awt-test
GraalVM version: GraalVM CE 20.0.1+9.1 (build 20.0.1+9-jvmci-23.0-b12) JDK major version: 20 OS: Ubuntu 20.04 Architecture: arm64
log: