How to fix "UnsatisfiedLinkError" - java

I'm trying to create Java software that allows me to start a program and control it through ActiveXComponent. In order to use ActiveXCompnent I downloaded a JAR file named "jacob-1.18". When I am in runtime and I try to start the program this exception occurs:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no jacob-1.18-x64 in java.library.path
How can I solve this problem?
I tried to follow this solution but the error remains:
UnsatisfiedLinkError with JACOB and jre 1.7
Thanks in advance.

Related

Exception in thread "main" java.lang.UnsatisfiedLinkError: no openalprjni in java.library.path

I'm trying to use Java bindings for the project https://github.com/openalpr/openalpr
When I try to launch the java application i got this exception
Exception in thread "main" java.lang.UnsatisfiedLinkError: no openalprjni in java.library.path
I try to load the library in this way:
System.loadLibrary("openalprjni");
The file named libopenalprjni.so it's in this dir
/Users/mario/Sviluppo/openalpr/src/bindings/java
so i'm trying, with eclipse, to load it with this configuration as a VM argument
-Djava.library.path=/Users/mario/Sviluppo/openalpr/src/bindings/java/ but nothing happens
What i'm doing wrong?
Include the openalpr.dll and the required all other dll files from the binaries to your JRE or JDK bin directory. Then try to compile and run your program.
Worked for me.
for me worked:
System.load("/usr/lib/libopenalprjni.so");

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jep in java.library.path

I have 'libjep.so' file after downloading jep and I also had set the environmental variable LD_LIBRARY_PATH in ~./bashrc as shown below:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python2.7/dist-packages/jep/libjep.so
as well as in runtime
System.load("/usr/local/lib/python2.7/dist-packages/jep/libjep.so");
But when I have the follwing line in my code,
Jep jep = new Jep();
It shows the below error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jep in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at jep.Jep$TopInterpreter$1.run(Jep.java:118)
at java.lang.Thread.run(Thread.java:745)
Thanks
You need to set the LD_LIBRARY_PATH to the directory containing your library, and not your library itself like this
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python2.7/dist-packages/jep/
You can also try adding this argument to the java command when you start your java application so java can find the library
-Djava.library.path=/usr/local/lib/python2.7/dist-packages/jep/
The java.lang.UnsatisfiedLinkError occurs only when if the required library is not in the path or it is already loaded.
Couple of things you need to make sure is :
1) You're performing System.load(....) inside static block so that its executed only once.
2) Also, you can try removing extension.

How to connect JPL with SWI-Prolog in Mac OS X

Hi i have a problem with a jpl interface. I want connect JPL with swi-prolog installed with mac-ports with eclipse. I have a jpl.jar and i have tried to import the jar file in eclipse with build path but i have this error: "no jpl in java.library.path".
So i have copied libjpl.dylib in a /opt/local/lib/swipl-7.1.29/bin/ and when i execute the code i have this error: "Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/local/lib/swipl-7.1.29/bin/libjpl.dylib: dlopen(/opt/local/lib/swipl-7.1.29/bin/libjpl.dylib, 1): Library not loaded: /Users/janw/stable/lib/swipl/lib/x86_64-darwin13.0.0/libswipl.dylib
Referenced from: /opt/local/lib/swipl-7.1.29/bin/libjpl.dylib
Reason: image not found"
After a anoying waste of time i found the solution about that problem.
First of all, its completely necesary to install swi-prolog via macports, if not, as i did, when you point in the
Djava.library.path=/users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0
this exception will apear
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0/libjpl.dylib: dlopen(/Users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0/libjpl.dylib, 1): Library not loaded: /Users/janw/stable/lib/swipl/lib/x86_64-darwin13.0.0/libswipl.dylib
Referenced from: /Users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0/libjpl.dylib
Reason: image not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at jpl.JPL.loadNativeLibrary(JPL.java:100)
at jpl.fli.Prolog.<clinit>(Prolog.java:85)
at jpl.Query.open(Query.java:286)
at jpl.Util.textToTerm(Util.java:162)
at jpl.Query.<init>(Query.java:198)
at consultasProlog.Consultas.consultaFicheroProlog(Consultas.java:19)
at utilidades.RellenarModelo.ejecutarArchivo(RellenarModelo.java:30)
at javaprolog.JavaProlog.main(JavaProlog.java:30)
Java Result: 1
So follow these steps.
port install swi-prolog on terminal , if you dont have install already macports command not found will apear so go to https://www.macports.org/install.php and install macports.
navigate to the path of swi prolog macports installation which mine is
/opt/local/lib/swipl-6.6.6/lib/x86_64-darwin14.0.0
copy this path and set in java.library.path in the java VM as -Djava.library.path=/opt/local/lib/swipl-6.6.6/lib/x86_64-darwin14.0.0
Now .pl with jpl.jar will be able to execute and the consults will run.
Hope it will help you and every person who find this hell problem.
Cheers frank.

Exception in thread "main" java.lang.UnsatisfiedLinkError: no libopencv_java247 in java.library.path

In oder to create a simple opencv java project I folled this tutorial step by step but
when I run the associated exemple I get the folowwing error :
Exception in thread "main" java.lang.UnsatisfiedLinkError: no libopencv_java247 in java.library.path
EDIT
I read all similar questions and I try those solutions
--
-Djava.library.path=/home/noura/Desktop/opencv/build/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/noura/Desktop/opencv/build/lib
but the problem is not solved
just I should write
System.loadLibrary("opencv_java247");
instead of
System.loadLibrary("libopencv_java247");

Exception in thread "AWT-EventQueue-0"

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no jpcap in java.library.path
is the error I keep getting, do I need to add a path to jcap? or change my configurations?
UnsatisfiedLinkError means that Java cannot find a native library. If you're on Windows, it's looking for jpcap.dll; if it's Linux or OS X, it's probably jpcap.so. You need to set the system property java.library.path to include the directory that contains the library.
For example, if you have jpcap.dll in a directory named C:\MyProject:
java -Djava.library.path=C:\MyProject com.mypackage.MyProgram

Categories

Resources