DP_ DP_ - 1 month ago 9
Java Question

Windows\System32\lpsolve55j.dll: Can't find dependent libraries

When I try to use LPSolve for Java (mavenized version, http://code.google.com/p/lpsolve-java/source/checkout ), I get following error:

java.lang.UnsatisfiedLinkError: C:\Windows\System32\lpsolve55j.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at lpsolve.LpSolve.<clinit>(LpSolve.java:274)


I


  • put lpsolve55j.dll in Windows\System32 and

  • added the directory C:\Program Files\LPSolve IDE to the PATH environment variable.



The error occurs both in eclipse (test case) as well as during execution of "mvn test".

None of this helps.

How can I fix this error?

Answer

I did the following thing and it seems to work:

  1. Downloaded the dev package that fits my processor (64 bit)
  2. Extracted the archive into a folder
  3. Copied lpsolve55j.jar and lpsolve55j.dll into the directory from step 2
  4. Added the directory from step 2 to the PATH
  5. Included lpsolve55j.jar from the directory in step 2 into my java project (as an external directory).

Now it works.