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
Related
Can anyone write me how to deal with this error? I am running a project with eclipse (from 2012-2014) configured for Windows. I do it on a Mac but Parallels whit windows 11
What library to use and how to add it, if something else needs to be done ?
Exception in thread "main" java.lang.UnsatisfiedLinkError: no bridge2java in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at com.ibm.bridge2java.OleEnvironment.Initialize(OleEnvironment.java:10)
at tr.com.yurticikargo.kopsproject.client.YKEdsFrame.main(YKEdsFrame.java:41)
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.
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");
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.
I got scip optsuite from http://scip.zib.de/#scipoptsuite .
It works fine as a standalone program and with the python interface, but I faced the following JNI error when I ran the example.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jscip-0.1.darwin.x86_64.gnu.opt.spx in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at de.zib.jscip.nativ.jni.JniScipLibraryLoader.loadLibrary(JniScipLibraryLoader.java:7)
at JniKnapsack.main(JniKnapsack.java:34)
The OS is OS X 10.10.5.
I compiled JNI with
make soplex GMP=false
make scip GMP=false ZIMPLE=false
The lib directory for JNI (path-to-scipoptsuite/scip-3.2.0/interfaces/jni/lib) contains the followings, and is referenced by LD_LIBRARY_PATH:
jniinc# -> /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/include
libjscip-0.1.darwin.x86_64.gnu.opt.spx.so*
libjscip.darwin.x86_64.gnu.opt.so# -> libjscip-0.1.darwin.x86_64.gnu.opt.spx.so
libjscip.so# -> libjscip-0.1.darwin.x86_64.gnu.opt.spx.so
liblpispx.darwin.x86_64.gnu.opt.so
libnlpi.cppad.darwin.x86_64.gnu.opt.so
libscip.darwin.x86_64.gnu.opt.so
libsoplex.darwin.x86_64.gnu.opt.so
scip# -> ../../..
scip.jar
soplex# -> ../../../../soplex-2.2.0
I would be happy if you could give me a suggestion.
Accordiong to mueldgog's advice, I changed the extension to jnilib. Then another error occurred:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /.../scipoptsuite-3.2.0/scip-3.2.0/interfaces/jni/lib/libjscip-0.1.darwin.x86_64.gnu.opt.spx.jnilib: dlopen(/.../scipoptsuite-3.2.0/scip-3.2.0/interfaces/jni/lib/libjscip-0.1.darwin.x86_64.gnu.opt.spx.jnilib, 1): Library not loaded: lib/liblpispx-3.2.0.darwin.x86_64.gnu.opt.so
Referenced from: /.../scipoptsuite-3.2.0/scip-3.2.0/interfaces/jni/lib/libjscip-0.1.darwin.x86_64.gnu.opt.spx.jnilib
Reason: image not found
otools says:
Load command 11
cmd LC_LOAD_DYLIB
cmdsize 72
name lib/liblpispx-3.2.0.darwin.x86_64.gnu.opt.so (offset 24)
In a Linux environment, where I successfully run the same command, lld says
liblpispx.linux.x86_64.gnu.opt.so => /.../scipoptsuite-3.2.0/scip-3.2.0/lib/liblpispx.linux.x86_64.gnu.opt.so (0x00002b66b3d35000)
So I think I should fix the reference to the absolute path on OS X, but don't know how to fix it.
Could you give any advice for this?