title: jna load library
body: <p>i'm having a problem on loading a dll with jna. While i can debug the code within eclipse, i get an Exception when i export and run it as a jar file:</p>
  
  <p>java.lang.UnsatisfiedLinkError: unable to load library 'SiUSBXp'</p>
  
  <p>Any ideas why it does not find my dll when i run it as a jar-file?</p>
  
  <p>Thanks!!!!</p>
  
  <pre><code>public interface SiUSBXp extends StdCallLibrary {
      byte SI_GetNumDevices(IntByReference numdevices);
      byte SI_GetProductString( int deviceNum, byte[] productString, int options );
      byte SI_Open(IntByReference numdevices);
  }
  
  static SiUSBXp INSTANCE;
  
  public static void main(String[] args) {
      System.setProperty("jna.library.path","SiUSBXp.dll");
      HashMap&lt;String, StdCallFunctionMapper&gt; optionMap = new HashMap&lt;String, StdCallFunctionMapper&gt;();
      StdCallFunctionMapper myMapper = new StdCallFunctionMapper();
      optionMap.put(Library.OPTION_FUNCTION_MAPPER, myMapper);
      INSTANCE = (SiUSBXp) Native.loadLibrary("SiUSBXp", SiUSBXp.class, optionMap);
  }
  </code></pre>
  
  <p>------------------ EDIT ----------------------</p>
  
  <p>The dll is located in the same folder as the jar is</p>
  
  <p>------------------ EDIT 2 ---------------------</p>
  
  <p>I've just tried to run it within windows xp and it works .. but it does not within windows 7 (64 bit)</p>
  
  <p>------------------ EDIT 3 ---------------------
  I've solved the problem ... It was due to the java versions installed ... I removed them all, and then only installed the x86 version of java ... after that it worked perfectly</p>