在从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中
libOpenNI.jni.dylib
我现在的问题是:这个猜测正确吗,以及如何libOpenNI.jni.dylib在netbeans中添加到java.library.path中。
提前Thx
将此添加到projects属性的VM选项中:-Djava.library.path = / Users / olivierjanssens / Development / Kinect / OpenNI / Lib /
这是dylib文件的地方