title: JNI - exception on native method
body: <p>I'm trying to use dll in my java application in eclipse, but I'm getting runtime exception whenever I try to call any method associated with that dll.</p>
  
  <p>The dll exists in the following address, which I've passed in <strong>Run/Debug Settings</strong> in eclipse:</p>
  
  <pre><code>-Djava.library.path="C:\Program Files\NPortAdminSuite\ipserial\lib\x86;${env_var:PATH}"
  </code></pre>
  
  <p><strong>Code:</strong>   </p>
  
  <p>class Test {</p>
  
  <pre><code>  public native int nsio_init();
  
    public static void main(String[] args) {
            System.loadLibrary("ipserial");
            new Test().nsio_init(); //This part is throwing an exception
    }
  }
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>Exception in thread "main" java.lang.UnsatisfiedLinkError: NPortConnection.nsio_init()I
      at Test.nsio_init(Native Method)
      at Test.main(Test.java:27)
  </code></pre>
  
  <p>The command <code>dumpbin /exports "C:\Program Files\NPortAdminSuite\ipserial\lib\x86\IPSerial.dll"</code> also returning me the name of method, which I'm trying to call from that dll
  <img src="https://i.stack.imgur.com/h6UJT.png" alt="enter image description here"></p>
  
  <p>Could anyone please tell how to solve this problem?</p>