Skip to content
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

MacOS native-image: No awt in java.library.path #8602

Closed
ruwi-next opened this issue Mar 19, 2024 · 1 comment
Closed

MacOS native-image: No awt in java.library.path #8602

ruwi-next opened this issue Mar 19, 2024 · 1 comment
Assignees

Comments

@ruwi-next
Copy link

Describe the issue
When building a native-image that uses System.loadLibrary("awt") on macos. native-image does not output any dylibs, only the executable binary.

Produced artifacts:
/graal_shared_libs/Foo (executable)

When running the binary it throws an exception UnsatisifiedLinkError

Exception in thread "main" java.lang.UnsatisfiedLinkError: No awt in java.library.path
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibraryRelative(NativeLibrarySupport.java:136)
        at [email protected]/java.lang.ClassLoader.loadLibrary(ClassLoader.java:106)
        at [email protected]/java.lang.Runtime.loadLibrary0(Runtime.java:916)
        at [email protected]/java.lang.System.loadLibrary(System.java:2063)
        at Foo.main(Foo.java:8)
        at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)

I have tried changing java.library.path to point at the dylib directory but to no avail.

I have also tested the same code on windows and it works there (correctly produces the dlls and no link exception).

Steps to reproduce the issue
I have created a reproducible repo that demonstrates the issue

  1. Clone https://github.com/ruwi-next/graal-shared-libs
  2. Run make run_native

Describe GraalVM and your environment:

  • native-image 21.0.2 2024-01-16
  • GraalVM Runtime Environment Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30)
  • Substrate VM Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS, serial gc, compressed references)
  • OS: macos Sonoma 14.2.1
  • Architecture: ARM64

Any help is much appreciated.

@fernando-valdez
Copy link
Member

Hi @ruwi-next thanks for reporting this issue. But unfortunately, this is a known issue.
You can track the efforts on solving the problem here: #4921
Additionally, you can read a little about this issue in the comments of the open ticket: #4124

I will close this issue as it is duplicated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants