javaexceptionunsatisfiedlinkerror

Getting UnsatisfiedLinkError - please assist


I've got a 3rd party class file which I wrapped in a jar file, added the jar path to my project classpath and tried to use.

The class includes the following:

static
{
 _isloaded = false;
try
{
  Runtime.getRuntime().loadLibrary("some-dll-name (no extension!)");
  _isloaded = true;
}
 catch (Exception localException) {}catch (Error localError) {}
}

When I try to use this class from my code, I get the UnsatisfiedLinkError exception:

java.lang.UnsatisfiedLinkError: lrapi1.vtc.connect(Ljava/lang/String;II)Z at lrapi1.vtc.connect(Native Method) at Actions.init(Actions.java:64)

From what I have read so far, it is probably that the dll cannot be found by the JVM. So I put it in c:\windows\system32 and in my project source folder.

But still the exception is thrown.


Solution

  • It was a DLL positioning issue.