Open kb-1000 opened 2 years ago
AWT, especially on JDK17+, is not designed to be statically linked. That's why you get the duplicate symbol: jvm
error. We are working on switching to dynamically linking AWT on Linux and macOS, similar to how it's already done for Windows. While this won't make it into the 22.3, we hope to have this ready for the 23.0 release.
Describe the issue Using lld as the linker makes using headless AWT together with OperatingSystemMXBean fail. (I'm using lld because if I use gold, debug info gets corrupted in my project, making gdb crash, while lld doesn't do that)
Steps to reproduce the issue Please include both build steps as well as run steps
javac AWTJMXTest.java
native-image -Djava.awt.headless=true --native-compiler-options=-fuse-ld=lld AWTJMXTest
build fails, thus no run steps
Describe GraalVM and your environment:
More details Consider adding the
--native-image-info
and--verbose
flags when building your native image and paste output below.Add any other information about the problem here. Especially important are stack traces or log output. Feel free to link to gists or to screenshots if necessary.