-1

I have 'xxx.dll' file along with a couple of other dlls at the location -

'C:\Program Files (x86)\abc\xyz\Librerias'

trying to load this dll file in my project using

System.loadLibrary("xxx");

added this path to 'Native library location' in JRE System Library in Configure Build Path but still the line trying to load this dll is throwing 'UnsatisfiedLinkError'.

I even tried but still same error remains.

System.load("C:/Program Files (x86)/abc/xyz/Librerias/xxx.dll");

I do have latest version of 32-bit JRE and JDK added in my system path and I am using a 64-bit machine.

Raviteja Reddy
  • 109
  • 2
  • 14
  • Ah! Looks like the file cannot be loaded, try changing the path to something like `System.load("C:\\Program Files (x86)\\abc\\xyz\\Librerias\\xxx.dll");` – robot_alien Sep 19 '18 at 10:44
  • No. I tried that, still the same issue. – Raviteja Reddy Sep 19 '18 at 11:14
  • Please, can you verify if the library `xxx.dll` exists at the given path? May be there is some permission issue, because it is in the `C:\Program Files` path? Try copying the said library to some other path, provide an absolute path and re-try. Also, note that if the library is already loaded by your application and the application tries to load it again, the `UnsatisfiedLinkError` will be thrown by the `JVM`. – robot_alien Sep 19 '18 at 15:08
  • Yes. Library exists. It is the first dll that is tried to be loaded to the application so no chance for the second case. I tried copying them outside and referring absolute path but no luck. The answer I provide solved the issue any thoughts on why such a change worked? – Raviteja Reddy Sep 20 '18 at 04:38

1 Answers1

0

The system was not able to navigate to that directory because of those non-existent paths. In order to solve that I just did opposite, added location of native library in front of PATH and it worked like a charm.

this helped.

Raviteja Reddy
  • 109
  • 2
  • 14