I can not start my application with JNA dependencies. Compilation of the app was ok, but on starting/runtime
the JNA library can not be found. From the IDE - no problem but not from the native-compiled version.
Did I forget something for loading resources? How can I configure graalvm to make them find the dependency? I am using the gradle-plugin: org.graalvm.buildtools.native
Exception in thread "main" java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/win32-x86-64/jnidispatch.dll) not found in resource path ()
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1059)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1015)
at com.sun.jna.Native.<clinit>(Native.java:221)
at com.sun.jna.NativeLong.<clinit>(NativeLong.java:35)
at [email protected]/java.lang.Class.ensureInitialized(DynamicHub.java:579)
Got it, it worked with the following combination:
I used the Graal-Agent to generate metadata-files (Tracing Agent)
Added all of them to the gradle definition like this
added
buildArgs.add('-H:+JNI')
removed
buildArgs.add('--initialize-at-build-time')
(Don't know why this is required)