title: Ubuntu Java OpenJDK not finding shared libraries
body: <p>I am trying to get the oracle oci driver working in ubuntu.</p>
  
  <p>I have openjdk version "1.8.0_91"</p>
  
  <p>I have installed sqlplus and I can see it's shared libraries in a folder here:</p>
  
  <pre><code>/usr/lib/oracle/12.1/client64/lib
  </code></pre>
  
  <p>At first sqlplus didn't work and was complaining it could not find shared libraries.</p>
  
  <p>To fix this I have created a file in <code>/etc/ld.so.conf</code> called <code>oracle.conf</code></p>
  
  <p>It contained as single line:</p>
  
  <pre><code>/usr/lib/oracle/12.1/client64/lib
  </code></pre>
  
  <p>I then ran <code>sudo ldconfig</code> and <code>sqlplus</code> now works.</p>
  
  <p>My problem is that Java programs still can't find the library. I run the command:</p>
  
  <pre><code>java -XshowSettings:properties
  </code></pre>
  
  <p>and I can see the property for the libraries:</p>
  
  <pre><code>java.library.path = /usr/java/packages/lib/amd64
      /usr/lib/x86_64-linux-gnu/jni
      /lib/x86_64-linux-gnu
      /usr/lib/x86_64-linux-gnu
      /usr/lib/jni
      /lib
      /usr/lib
  </code></pre>
  
  <p>When I run the Java code I get the error:</p>
  
  <pre><code>java.lang.UnsatisfiedLinkError: no ocijdbc12 in java.library.path
  </code></pre>
  
  <p>When I run ldconfig -v I can see a section at the top:</p>
  
  <pre><code> - /usr/lib/oracle/12.1/client64/lib:
                 liboramysql12.so -&gt; liboramysql12.so
                 libmql1.so -&gt; libmql1.so
                 libnnz12.so -&gt; libnnz12.so
                 libons.so -&gt; libons.so
                 libipc1.so -&gt; libipc1.so
                 libocijdbc12.so -&gt; libocijdbc12.so
                 libsqlplusic.so -&gt; libsqlplusic.so
                 libsqlplus.so -&gt; libsqlplus.so
                 libheteroxa12.so -&gt; libheteroxa12.so
                 libclntsh.so.12.1 -&gt; libclntsh.so.12.1
                 libociei.so -&gt; libociei.so
                 libclntshcore.so.12.1 -&gt; libclntshcore.so.12.1
                 libocci.so.12.1 -&gt; libocci.so.12.1
  </code></pre>
  
  <p>and as you can see the library is present.</p>
  
  <p>I thought that maybe the environment variable LD_LIBRARY_PATH may need to be set. It is currently empty. If I set it:</p>
  
  <pre><code>LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
  </code></pre>
  
  <p>I get the same error when running my code and <code>java -XshowSettings:properties</code> hasn't changed.</p>
  
  <p>Does anyone know why java is not picking up the library? </p>