从openni编译演示时,偶然发现了这个错误:
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)
我在我的Mac上这样做。我最好的猜测是这个文件libOpenNI.jni.dylib
不在我的java.library.path
我现在的问题是:这是猜对了,我如何在netbeans中将libOpenNI.jni.dylib
添加到我的java.library.path。
提前谢谢
答案 0 :(得分:5)
将此添加到项目的VM选项中 property:-Djava.library.path = / Users / olivierjanssens / Development / Kinect / OpenNI / Lib /
这是dylib文件的位置