pranav
pranav

Reputation: 31

GLPK java java.lang.UnsatisfiedLinkError: Can't find dependent libraries

The dynamic link library for GLPK for Java could not be loaded. Consider using

java -Djava.library.path=
The current value of system property java.library.path is:
\\MILP\lib\glpk-4.55\w64
Exception in thread "main" java.lang.UnsatisfiedLinkError: 
\\MILP\lib\glpk-4.55\w64\glpk_4_55_java.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 org.gnu.glpk.GLPKJNI.<clinit>(GLPKJNI.java:24)
    at org.gnu.glpk.GLPK.glp_version(GLPK.java:2259)
    at TestMain.main(TestMain.java:7)
  1. I have added the correct JAR file
  2. I have given the correct native path for the library

Still the problem persists,

One doubt I have is that the \MILP\lib\glpk-4.55\w64\glpk_4_55_java.dll file is flawed. I checked it using dependencyWalker there it shows some warnings

Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.

Any leads would be appreciated

Upvotes: 3

Views: 1791

Answers (2)

Maarten
Maarten

Reputation: 918

You can add the C:\Program Files\GLPK\glpk-4.55\w64 folder to your PATH environment variable

or

copy the glpk_4_55.dll and glpk_4_55_java.dll to C:\Windows\System32 as suggested by Pradeepb

Upvotes: 1

Pradeepb
Pradeepb

Reputation: 2572

I also faced same issue. I copied glpk_4_55.dll and glpk_4_55_java.dll to C:\Windows\System32 and Everything works fine for me.

Upvotes: 5

Related Questions