-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no awt in java.library.path #2842
Comments
@abamoshe please provide the reproduce or the instructions to reproduce this error |
just download the jar from hare https://github.com/abamoshe/ConnectWise_portable/releases/tag/0.0.0 and run |
@mcraj017
just run
|
@abamoshe thanks for the reproducer |
Having the same issue here with SystemTray.getSystemTray() |
I get the same error using SXSSFWorkbook in Apache POI
|
Are there any updates on this issue? I have faced a similar problem |
This should be fixed for the LINUX_AMD64 platform in the latest 20.3 build |
I ran into a similar issue (see below) and just in case someone else is too on macOS: According to @vjovanov, additional work for macOS is still needed to make this work.
|
And what about Windows? |
Same, as MacOS. Still the work needed now is an order of magnitude smaller than what was necessary for LINUX. @pejovica have you tried it out on Windows? |
graalvm-ce-java11-20.3.0 : has same exception on windows
graalvm-ce-java11-21.0.0-dev : has same problem on windows
|
Can confirm, same problem on Windows |
@vjovanov I'm still hitting this with 20.3.0 Linux AMD64 CE that was released this week. Is there a build or deploy time flag needed to link |
FWIW in Mandrel we had to backport 5d2997a to 20.3 to get a similar case resolved |
@zakkak interesting. Is there an equivalent of https://quay.io/repository/quarkus/ubi-quarkus-native-image for mandrel 20.3.0? If so, I'd like to test that out to see if I can get this working. I can test out a CR or the like as well. |
@sherl0cks sure. It's https://quay.io/repository/quarkus/ubi-quarkus-mandrel:20.3-java11 (in Beta at the moment) :) |
@zakkak brilliant. Will let you know how it goes. Thank you very much! |
Unfortunately, the AWT patch didn't make it into 20.3 as it was considered dangerous for stability. To get the code that works with AWT you will have to rely on our dev builds or wait for 21.0. |
windows GraalVM 22.3.1 jdk17 Still getting java.lang.UnsatisfiedLinkError: no awt in java.library.path |
Tried it also on MacOS x86 and indeed issue persists. |
I am verifying that I am getting the error on Windows 10 as well |
any news for hook awt with javafx on windows, maybe has other way for include this libs on native exe bundle? |
@GenCloud @javasuns |
It's July 2023 and I've just built/run a simple Swing app that uses the SystemTray on Linux and getting the [java.lang.UnsatisfiedLinkError: no awt in java.library.path] error when I run the GraalVM executable. I'm using graalvm-jdk-17.0.7+8.1 on Linux Mint 21. I see comments that this is fixed on Linux, but have my doubts about that. And yes, prior to running the native-image I ran [-agentlib:native-image-agent=config-output-dir]. When I look into the reflect-config.json config file I don't see any reference to the awt toolkit or system tray. $ ./app In addition, I created the most minimal JavaFX app using [https://start.gluon.io/] and then fed it into GraalVM after creating the agent config files. Again, it built OK but at runtime: Exception in thread "main" java.lang.RuntimeException: No toolkit found |
I experienced this as well when a try to run a Spring Boot 3 into GraalVM docker image on Win10.
My dependency tree:
|
I'm having the exact same issue here, graalvm-jdk-20.0.2+9.1 on Ubuntu 20.04.6, with a Spring Boot native app. |
It would be nice to have a series of really detailed simple examples/tutorials that worked with AWT/Swing on Win/Lin/Mac, if it is indeed supported. I see a hello-world example on GraalVM's website but how about one that writes hello-world into a Swing dialog. To build it do we have to set the application to headless mode or not? If we set it to headless what are the downstream implications of this when it comes to loading the awt toolkit, a simple application that draws on the system-tray class, apps with and without the Maven plugin, etc, etc. Because I don't think this area is well covered and certainly not well documented. AWT/Swing is either supported or it is not and if it is then needs it needs detailed instructions of how to get it working. I've spent some time trying to get the most basic application to first build and then run and still no closer. Thus, I've had to give up. |
See the same on graalvm-jdk-20.0.2+9.1 with MacOS Sonoma running on an Intel chipset. |
Same issue with java 21 and spring boot 3 :( |
Got: No awt in java.library.path at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibraryRelative(NativeLibrarySupport.java Which version of native-image I can try to run very simple code like this in native-image: import ij.IJ; import javax.imageio.ImageIO; @component
} |
Hello , Still I'm facing the same issue I'm using java17 and graalvm-ce-java17-22.3.0 version .can any one tell me is this issue fixed ?if yes please help me to solve the issue. |
You can try to use Liberica NIK based on GraalVM: https://bell-sw.com/blog/how-to-turn-awt-applications-into-native-images/ |
Still an issue using Could you please re-open this issue @vjovanov 🙂
|
@NicklasWallgren to get this fixed it would be best to open a new ticket for this problem with a minimal reproducer. |
Hi @vjovanov , I created a super tiny project reproduce-awt-lib-error-graal reproducing this error. There's only one class (copy-pasted below). Does this look useful? If so, I will open a new ticket.
Stack trace:
|
Hi @tabiStein, any news? Thanks |
I never heard back from @vjovanov, but since my post got several upvotes I just created the new issue here: #8273 |
@pejovica is in charge of this ticket, so I left the response to him. It seems it fell through the cracks so sorry for the delay. |
Hey, Any news on that, it's really a blocker for us |
@dlevi-cs If you click into the linked ticket I added a few posts ago, it's looking like it's a Paketo problem (linked to my ticket). They've marked it as an enhancement. Feel free to comment on that issue -- I think the Graal team has already done all they can on this one. |
hare is my project https://github.com/abamoshe/ConnectWise_portable/releases/tag/0.0.0
im running native-image -jar ConnectWise.jar --no-fallback -H:NativeLinkerOption=prefs.lib
and on runtime i get this error:
(the -H:NativeLinkerOption=prefs.lib is becose of #2363 (comment)
i'v also downloaded the dev version to avoid this #2363 (comment))
The text was updated successfully, but these errors were encountered: