title: Issues loading .so file with JNA in Spring Boot on Linux
body: <p>I have an application written in Java with Spring Boot. This application needs to load .so files that are bundled with the project, I am using JNA to accomplish this. However, the JNA loader doesn't seem to be able to pick up the .so files and the application fails to start.</p>
  
  <p>I've tried running the application from within IntelliJ and by running the packaged .jar with "java -jar". The .so files are kept in src/main/resources/linux-x86-64 for now. I've tried keeping them in a different directory, e.g src/main/resources/libs/linux-x86-64 and set the property "jna.library.path", but JNA still fails to find the files.</p>
  
  <p>This is the debug log for JNA:</p>
  
  <pre><code>Trying (via loadLibrary) jnidispatch
  Looking in classpath from sun.misc.Launcher$AppClassLoader@18b4aac2 for /com/sun/jna/linux-x86-64/libjnidispatch.so
  Found library resource at jar:file:/home/dalivi/.m2/repository/net/java/dev/jna/jna/4.5.0/jna-4.5.0.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
  Trying /tmp/jna--1339148563/jna4246531844315283838.tmp
  Found jnidispatch at /tmp/jna--1339148563/jna4246531844315283838.tmp
  Looking for library 'GTransTF'
  Adding paths from jna.library.path: null
  Trying libGTransTF.so
  Adding system paths: [/usr/lib/x86_64-linux-gnu, /lib/x86_64-linux-gnu, /lib64, /usr/lib, /lib, /lib/i386-linux-gnu, /usr/lib/i386-linux-gnu, /usr/lib/x86_64-linux-gnu/libfakeroot]
  Trying libGTransTF.so
  Looking for version variants
  Looking in classpath from sun.misc.Launcher$AppClassLoader@18b4aac2 for GTransTF
  Found library resource at file:/home/dalivi/Workspace/java/geotransboot/target/classes/linux-x86-64/libGTransTF.so
  Looking in /home/dalivi/Workspace/java/geotransboot/target/classes/linux-x86-64/libGTransTF.so
  2019-04-25 12:43:38.032 ERROR 25897 --- [o-auto-1-exec-1] s.l.g.c.TransformationRestController     : Handler dispatch failed; nested exception is java.lang.UnsatisfiedLinkError: libCoreGTrans.so: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>I does seem to find one of the files in the directory: <strong>libGTransTF.so</strong>, but then immediately fails when trying to find the file <strong>libCoreGTrans.so</strong> which is present in the same directory as the previous file.</p>
  
  <p>I should mention, on Windows, this works just fine. JNA finds the corresponding dll files in the directory specified with "jna.library.path".</p>