I am writing an interface in Java which uses underneath library in "C". Now, when I try to load the library specifying relative path, it cannot find the library. If I give the absolute path, it works fine.
I want to know, is there something to do with relative and absolute path on MAc OS. Because same code works well on linux(even though I specify relative path on that).
Please Help.
Defining the system property jna.debug_load
(pass -Djna.debug_load=true
to your JVM) will result in console output indicating where JNA is looking for your native library.
Keep in mind you need to define jna.library.path
to be the directory where JNA can find your library. That value should be an absolute path. If you're using something like myapp/libs
then your operation is going to be dependent on whatever the process's current directory is set to.