## Resolving Unsatisfied link error in OpenNI java on Windows

If you are getting any of the following error while trying to Run OpenNI on a windows PC, follow the below steps to rid of the errors (I am assuming you are using Eclipse)

java.lang.UnsatisfiedLinkError: C:\Program Files\OpenNI2\Redist\OpenNI2.jni.dll: Can't find dependent libraries

or

I am also assuming you have installed OpenNI2 in the folder C:\Program Files\OpenNI2

• Then got Run -> Run Configurations and choose the tab named "Arguments"
• In the section "VM Arguments" add the below entry
-Djava.library.path=C:\Progra~1\OpenNI2\Redist\

• Now we have to load the dll manually as below
``` try {
...
..
OpenNI.shutdown();
} catch (Exception e) {
e.printStackTrace();
}
```

1. In case of Ubuntu.. I had to follow a slightly different approach.
copy the files libOpenNI2.jni.so and libOpenNI2.so to /usr/local/lib and then set -Djava.library.path=/usr/local/lib

2. thanks for the clarification

3. I am getting the same error in while building OpenNi in nadroid?