ocijdbc11 Not found in java.library.path

Viewed 18719

I inherited a small java utility from other developer -- just a couple of .java files and executable .jar.

I run java program by passes a connection string. Now I need to change the connection string to Oracle from jdbc:oracle:thin:<user>/<password>@host to jdbc:oracle:oci:<user>/<password>@host to start using thick instead of thin driver.

As a result I get the error: "ocijdbc11 (Not found in java.library.path)".

Here my questions:

  1. Is ocijdbc11 a part of ojdbc7.jar? Or what file do java need? ANSW: ocijdbc11 is a library: /oracle/client/o11r2/lib/libocijdbc11.so
  2. How can I see which paths java uses to find that ocijdbc11?

Just in case:

$ ls /oracle/client/o12r1/

assistants     diagnostics    jlib           oui            slax
bin            dmu            ldap           owm            sqlplus
cdata          has            lib            perl           srvm
cfgtoollogs    hs             network        plsql          ucp
clone          install        nls            precomp        usm
crs            instantclient  odbc           QOpatch        utl
css            inventory      OPatch         racg           wwg
cv             javavm         opmn           rdbms          xdk
dc_ocm         jdbc           oracore        relnotes
deinstall      jdk            oraInst.loc    root.sh

UPD I tried to use option -Djava.library.path=/oracle/client/o11r2 and got other error. But I still don't know how to use Oracle 12.1 instead of 11.2.

UPD2 I've changed environment paths to use Oracle 12 instead of 11. And now error looks like ocijdbc12 (Not found in java.library.path). The file /oracle/client/o12r1/lib/libocijdbc12.so exists.

I added /oracle/client/o11r2/lib to LD_LIBRARY_PATH -- the same error (ocijdbc12 (Not found in java.library.path)). I tried option -Djava.library.path=/oracle/client/o12r2/lib -- the same error. Could you please help me to fix it?

2 Answers
Related