在编译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
添加到netbeans中的java.library.path .
提前致谢
将此添加到项目的VM选项中属性:-Djava.library。路径=/用户/olivierjanssens/开发/Kinect/OpenNI/Lib/
这里是dylib文件