How to fix an UnsatisfiedLinkError (Can't find dependent libraries)

Viewed 1144

I am having an issue when loading a dll file using java. I am getting java.lang.UnsatisfiedLinkError: Unable to load library 'C:\Users\GZammit\Documents\gapt\RwLibraries': Native library (win32-x86-64/C:\Users\GZammit\Documents\gapt\RwLibraries.dll) not found in resource path ...

This is my code :

ClassApi INSTANCE = (ClassApi) Native.loadLibrary(System.getProperty("user.dir")+"\\RwLibraries\\renderwarriors", ClassApi.class);

I did a lot of research and I know there are many with same error but none of the solutions worked for me. The weird thing is, it shows you which files it searched and one of the files is the actual path of the dll location. I even printed out both urls to confirm. I also placed the dll in many other location including the sysWOW64.

I also changed the java.library.path before loading the dll to make sure it is in that particular path without success either. I also followed multiple tutorials online doing exactly the same code without success.

I am using jna 4.4.0 jar file and jna-platform 4.4.0 . I checked the java path and also placed a dll in one of the paths mentioned.

There should be no error code-wise since it worked for my team but not on my computer. I also tried on two different computers.

Everything is 64-bit including the dll.

0 Answers
Related