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

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)
I have added the correct JAR file
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

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.

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

Related

java openmaple connection with eclipse

test.java simple example for openmaple
Hello buddies!
I have tried so many times to connect java to maple using openmaple but get below error. please help me, I'm using Eclipse as java editor. thanks in advance
`java.lang.UnsatisfiedLinkError: no jopenmaple in java.library.pathError loading libraries: java.lang.UnsatisfiedLinkError: no jopenmaple in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.maplesoft.openmaple.Engine.<clinit>(Unknown Source)
at test.main(test.java:23)
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.maplesoft.openmaple.Engine.getKernel([Ljava/lang/String;Lcom/maplesoft/openmaple/EngineCallBacks;Ljava/lang/Object;Ljava/lang/Object;)J
at com.maplesoft.openmaple.Engine.getKernel(Native Method)
at com.maplesoft.openmaple.Engine.<init>(Unknown Source)
at test.main(test.java:23)`
You likely need to ensure that Eclipse points to externalcall.jar, jopenmaple.dll, and Maple.jar.
First, add
C:\Program Files\Maple 15\java\externalcall.jar
C:\Program Files\Maple 15\java\Maple.jar
by right-clicking the project (I called mine OpenMaple), and going to Build Path > Add External Archives.
Second, create a sub-folder of the package called, say, DLLs, and copy the following file to this folder:
C:\Program Files\Maple 15\bin.X86_64_WINDOWS\jopenmaple.dll
Then, navigate to
Properties > Java Build Path > Source > OpenMaple/src > Native library location
and add OpenMaple/DLLs.

Unsatisfied Linker Error : library file not found

I am writing test cases for a class that calls the constructor of another class that has a static block that loads a c++ library,
static
{
System.loadLibrary("PixelProxy_jni");
}
I have specified the library path as,
-Djava.libarary.path=C:\Users\Desktop\libPixelProxy_jni.so
in the vm arguments in eclipse, but still it doesn't work.
Please help me find a solution for this
stack trace
java.lang.UnsatisfiedLinkError: no PixelProxy_jni in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.XrayPixelProxyInputStream.<clinit>(XrayPixelProxyInputStream.java:36)
at com.RadImageReader.readImage(RadImageReader.java:57)
at servicedisplay.ServiceImageDisplayer.showImage(ServiceImageDisplayer.java:124)
at servicedisplay.test1.ServiceImageDisplayerTest.testShowImageStringIntIntIntIntIntInt(ServiceImageDisplayerTest.java:95)
From that file path, it looks like you're on windows, which means that loadLibrary will not look for a file named libPixelProxy_jni.so, it will look for a file named PixelProxy_jni.dll. (You can find out exactly what it will look for by using System.mapLibraryName.)
You can either find a .dll of the library, compile one yourself, or try System.load, which allows you to load a native library from an absolute path:
System.load("C:\Users\Desktop\libPixelProxy_jni.so");
But that will only work if the library was actually compiled for windows.

JNI UnsatisfiedLinkError dependent libraries

I have a JNI dll along with a jar file that I have created on a machine with eclipse.
I am trying to deploy this to another machine and cannot get past the exception
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\CcmAccess\CcmJNIBase.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Meth
at java.lang.ClassLoader.loadLibrary1(Unknown Source)
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 com.sig.ccm.CcmBase.<clinit>(CcmBase.java:8)
at ReadTimeDomain.setupSample(ReadTimeDomain.java:24)
at ReadTimeDomain.main(ReadTimeDomain.java:97)
I have another program that prints out the java.library.path and I have verified the dll that this dll depends on as well as this dll are in the java.library.path.
I have read posts where they should go in the current directory and that doesn't work.
I have read posts where they should go in the jre/bin and that gets the same result.
Any help would be appreciated.
Edit:
If I take everything out of the path and force the classpath to only have the jar file and "." I get the message
Exception in thread "main" java.lang.UnsatisfiedLinkError: no CcmJNIBase in java.library.path
When I add the location of this dll into the path C:\CcmAccess I get the full message:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\CcmAccess\CcmJNIBase.dll: Can't find dependent libraries
On the machine that this seems to work all I had to do was add the dependent dll to my classpath.
Double check your java.library.path value.
Make sure that you are using an absolute path.
Relative paths will make you think your java.library.path is correct, when actually it is actually incorrect.
If you are adding "." in your java.library.path, then you need to double check the "current working directory" when you execute your code.
If you need to use a relative path in your java.library.path, make sure that the path is relative from the "working directory" when you execute your code.

How to proceed with this exception java.lang.UnsatisfiedLinkError?

this example of code generates an exception :
Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3235 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:134)
at org.eclipse.swt.internal.win32.OS.<clinit>(OS.java:18)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:125)
at Snippet262.main(Snippet262.java:34)
What does it mean please and how can I resolve it ?
Thank you
You need to add swt-win32-3235.dll to the library_path in your app. By default library_path equals to working dir (".") of your app. Or you may specify path to library_path in vm argument -Djava.library.path=path
So,
1.Check existing swt-win32-3235.dll in your library_path.
2. Check correct definition of library_path property.
This is a runtime exception, that means that the code uses shared library's (using jni probably) which it cannot load.
here you have two options:
the shared library is not installed on you system.
the path to the shared lib is not included in the LD_LIBRARY_PATH (on linux, not sure how it called on windows)
I got the error while running my application. The exception was
java.lang.UnsatisfiedLinkError exception :
SK.gnome.twain.TwainManager.initialize(I[B[BZ)V
I fix it in eclipse as below step, Windows>Preferences>Java>Install JREs>check jre6-32 (check the appropriate versions of jre that you have install in your system).

Eclipse / Java path problems

I'm currently following the third tutorial listed here: here
where I'm trying to compile some matlab code into Java classes. Creating a project in eclipse, and correctly linking the libraries (exactly how its done in the tutorial). Everything actually compiles, but when I run the program I get an Unsatisfied Link error.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: C:\Program Files\MATLAB\R2009b\bin\win32\BuilderJABootstrap.dll
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.<clinit>(MWMCR.java:1571)
at com.demo.DemoMCRFactory.<clinit>(DemoMCRFactory.java:100)
at com.demo.MLTestClass.<init>(MLTestClass.java:62)
at Driver.main(Driver.java:16)
The troubling part is the Can't load library: as the path provided '\win32' is not a legitimate path on my computer as I have a 64 bit machine, so the dll is located at \win64. However, I've triple checked all my Environmental variables and am kind of stuck. Could I be using a 64-bit version of matlab, with a 32-bit library?
Thanks!
ChrisH's solution was it

Categories

Resources