title: java - loading library from java library path
body: <p>I am dependent on a library <code>src/main/resources/libs64/thelib.dll</code> which I need to load at runtime</p>
  
  <pre><code>System.setProperty("java.library.path", 
                      Paths.get(System.getProperty("user.dir"),
                        "src", "main", "resources", "libs64").toAbsolutePath().toString())
  </code></pre>
  
  <p>When I run the spring boot app</p>
  
  <pre><code>mvn package
  java -jar springapp.jar
  </code></pre>
  
  <p>I tells me </p>
  
  <pre><code>java.lang.UnsatisfiedLinkError: no src/main/resources/libs64/thelib in java.library.path
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) ~[na:1.8.0_92]
      at java.lang.Runtime.loadLibrary0(Runtime.java:870) ~[na:1.8.0_92]
      at java.lang.System.loadLibrary(System.java:1122) ~[na:1.8.0_92]
  </code></pre>
  
  <p>When I set the library path <code>src/main/resources/libs64</code> in Eclipse it works and the <code>java.library.path</code> prints out to the same as </p>
  
  <pre><code>Paths.get(System.getProperty("user.dir"),
                            "src", "main", "resources", "libs64").toAbsolutePath().toString())
  </code></pre>
  
  <p>Thanks for the help</p>