While compiling a demo from openni i stumbled across this error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no OpenNI.jni in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1758)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045)
at org.OpenNI.NativeMethods.<clinit>(NativeMethods.java:34)
at org.OpenNI.Context.initFromXmlEx(Context.java:317)
at org.OpenNI.Context.createFromXmlFile(Context.java:36)
at kitouch.UserTracker.<init>(UserTracker.java:113)
at kitouch.UserTrackerApplication.main(UserTrackerApplication.java:46)
Java Result: 1
BUILD SUCCESSFUL (total time: 4 seconds)
I'm doing this on my mac . And my best guess is that this file libOpenNI.jni.dylib is not in my java.library.path
My question now is: Is this guess right, and how do i add libOpenNI.jni.dylib to my java.library.path in netbeans.
Thx in advance
add this to VM option of the projects
property: -Djava.library.path=/Users/olivierjanssens/Development/Kinect/OpenNI/Lib/
this is where the dylib file
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 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 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?
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.
First sorry for my bad english..
Well, i'm having a huge problem with the 2 .jar or libraries JAVACV and OPENCV, i'm triying to build a LOGIN with Face tracking and Face Recognition, but when i try to run the Main.java popups this problem:
run:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_objdetect in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:701)
at com.googlecode.javacpp.Loader.load(Loader.java:578)
at com.googlecode.javacpp.Loader.load(Loader.java:532)
at com.googlecode.javacv.cpp.opencv_objdetect.<clinit>(opencv_objdetect.java:91)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at com.googlecode.javacpp.Loader.load(Loader.java:553)
at com.googlecode.javacpp.Loader.load(Loader.java:532)
at com.googlecode.javacv.cpp.opencv_objdetect$CvHaarClassifierCascade.<clinit>(opencv_objdetect.java:170)
at reconocimiento.ReconocimientoCaras.<init>(ReconocimientoCaras.java:51)
at reconocimiento.ReconocimientoCaras.<clinit>(ReconocimientoCaras.java:53)
at reconocimiento.Main.main(Main.java:25)
Caused by: java.lang.UnsatisfiedLinkError: C:\Users\Carlos\AppData\Local\Temp\javacpp42613800564148\jniopencv_objdetect.dll: Can't find dependent libraries
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:1851)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1062)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:690)
... 11 more
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
How can i solve this problem?
Check your OS that whether it is 32bit or 64bit.Then install the appropriate version opencv and javacv.