title: Specified module could not being found loading DLL in JNA
body: <p>I have this class initialiser:</p>
  <pre><code>System.setProperty(&quot;java.library.path&quot;, &quot;C:\\Users\\lucas\\Desktop\\libraries&quot;);
  System.loadLibrary(&quot;libTTARCHHelper&quot;);
  TTARCH_LIBRARY=(TtarchLibrary)Native.loadLibrary(TtarchLibrary.class);
  </code></pre>
  <p>And the DLL is located at <code>C:\\Users\\lucas\\Desktop\\libraries\\libTTARCHHelper.dll</code></p>
  <p>If I run this in Eclipse I get 'The specified module could not be found' and if I run it as a JAR I get 'no libTTARCHHelper in java.library.path'.</p>
  <p>How do I fix these? I even tried putting the DLL in a folder in the PATH environment variable.</p>
  <p>Full debug using the file direct load:</p>
  <pre><code>Aug 26, 2020 12:28:51 AM com.sun.jna.Native extractFromResourcePath
  INFO: Looking in classpath from jdk.internal.loader.ClassLoaders$AppClassLoader@c387f44 for /com/sun/jna/win32-x86-64/jnidispatch.dll
  Aug 26, 2020 12:28:51 AM com.sun.jna.Native extractFromResourcePath
  INFO: Found library resource at jar:file:/C:/Users/lucas/Desktop/My%20Stuff/Eclipse%20Workspaces/Build%20Paths/jna-5.6.0.jar!/com/sun/jna/win32-x86-64/jnidispatch.dll
  Aug 26, 2020 12:28:51 AM com.sun.jna.Native extractFromResourcePath
  INFO: Extracting library to C:\Users\lucas\AppData\Local\Temp\jna-103324076\jna5931694657592960137.dll
  Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
  INFO: Looking for library 'C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll'
  Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
  INFO: Adding paths from jna.library.path: null
  Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
  INFO: Trying C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll
  Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
  INFO: Loading failed with message: The specified module could not be found.
  
  Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
  INFO: Adding system paths: []
  Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
  INFO: Trying C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll
  Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
  INFO: Loading failed with message: The specified module could not be found.
  
  Aug 26, 2020 12:28:51 AM com.sun.jna.Native extractFromResourcePath
  INFO: Looking in classpath from jdk.internal.loader.ClassLoaders$AppClassLoader@c387f44 for C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll
  Aug 26, 2020 12:28:51 AM com.sun.jna.NativeLibrary loadLibrary
  INFO: Loading failed with message: Native library (win32-x86-64/C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll) not found in resource path (C:\Users\lucas\eclipse-workspace\TEST\bin;C:\Users\lucas\Desktop\My Stuff\Eclipse Workspaces\Build Paths\jna-5.6.0.jar)
  Exception in thread &quot;main&quot; java.lang.UnsatisfiedLinkError: Unable to load library 'C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll':
  The specified module could not be found.
  
  The specified module could not be found.
  </code></pre>
  <p>The rest of the trace:</p>
  <pre><code>Native library (win32-x86-64/C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll) not found in resource path (C:\Users\lucas\eclipse-workspace\TEST\bin;C:\Users\lucas\Desktop\My Stuff\Eclipse Workspaces\Build Paths\jna-5.6.0.jar)
      at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:301)
      at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:461)
      at com.sun.jna.Library$Handler.&lt;init&gt;(Library.java:192)
      at com.sun.jna.Native.loadLibrary(Native.java:646)
      at com.sun.jna.Native.loadLibrary(Native.java:630)
      at com.test.TTARCHHelper.&lt;clinit&gt;(TTARCHHelper.java:17)
      at com.test.main.main(main.java:6)
      Suppressed: java.lang.UnsatisfiedLinkError: The specified module could not be found.
  
          at com.sun.jna.Native.open(Native Method)
          at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191)
          ... 6 more
      Suppressed: java.lang.UnsatisfiedLinkError: The specified module could not be found.
  
          at com.sun.jna.Native.open(Native Method)
          at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:204)
          ... 6 more
      Suppressed: java.io.IOException: Native library (win32-x86-64/C:\Users\lucas\Desktop\libraries\libTTARCHHelper.dll) not found in resource path (C:\Users\lucas\eclipse-workspace\TEST\bin;C:\Users\lucas\Desktop\My Stuff\Eclipse Workspaces\Build Paths\jna-5.6.0.jar)
          at com.sun.jna.Native.extractFromResourcePath(Native.java:1095)
          at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:275)
          ... 6 more
  </code></pre>
  <p>So it looks like it doesnt find it , It throws a</p>
  <pre><code>java.lang.UnsatisfiedLinkError: The specified module could not be found.
  </code></pre>
  <p>I found the problem, the DLLs were for the wrong bit. Eclipse runs on 64 and the JAR uses the 32bit JVM. I downloaded the 32 bit dlls too and now it works when I run the JAR. However the 64 bit dlls in Eclipse keep throwing the module exception above</p>