Wednesday, October 23, 2013

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


java.lang.UnsatisfiedLinkError: no OpenNI2.jni in java.library.path

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

  • Make sure you have org.openni.jar in your project and added to your build path
  • Then got Run -> Run Configurations and choose the tab named "Arguments"
  • In the section "VM Arguments" add the below entry  

  • Now we have to load the dll manually as below
 try {
   System.load("C:\\Program Files\\OpenNI2\\Tools\\OpenNI2.dll");
                         .. your remaining code here
  } catch (Exception e) {


  1. In case of Ubuntu.. I had to follow a slightly different approach.
    copy the files and 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?


Blog Archive