JDBC OCI Driver Connection Fails: UnsatisfiedLinkError: no ocijdbc11 in java.library.path

(Doc ID 398948.1)

Last updated on MAY 16, 2017

Applies to:

JDBC - Version 11.1.0.7 and later
Information in this document applies to any platform.

Symptoms

On a  Solaris or Linux platform, a 11.2.0.3 JDBC OCI Driver client program is executed : 

[oracle@maple2 ociTest]$ $ORACLE_HOME/jdk/bin/java -cp $ORACLE_HOME/jdbc/lib/ojdbc5.jar:. Class1
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
11.2.0.3.0
jdbc:oracle:oci:@//maple2.ca.oracle.com/ORCL

This Java program is accessing a 11.2.0.3 Oracle database server ( running on the same machine as the Java client program).

Depending on the LD_LIBRARY_PATH environment variable settings, the UnsatisfiedLinkError exception is thrown :

 1. LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/dbhome_3/lib

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
11.2.0.3.0
jdbc:oracle:oci:@//maple2.ca.oracle.com/ORCL 

2. LD_LIBRARY_PATH=/instantclient_11_2/lib

Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc11 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1684)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3532)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3528)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:266)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:162)
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:280)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:207)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:157)
at Class1.getConnection(Class1.java:20)
at Class1.main(Class1.java:7)



The exception can also be of the form:

Changes

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms