My Oracle Support Banner

Oracle JDBC 12c OCI Client Looks For Ocijdbc10 In Java.library Path Resulting in java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path (Doc ID 2433621.1)

Last updated on AUGUST 30, 2023

Applies to:

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

Symptoms

Oracle JDBC 12c OCI Client is looking for ocijdbc10 in java.library path.

Oracle 12c R2 client is installed. While connecting to a Oracle 12.1 database using the OCI driver , using jdbc:oracle:oci:@<host>:<port>:<sid>, the following error is received as soon as the connection is being made:

java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2541)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:873)
at java.base/java.lang.System.loadLibrary(System.java:1857)
at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3147)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3143)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:221)
at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:441)
at oracle.jdbc.driver.T2CConnection.(T2CConnection.java:132)
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:78)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:678)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)

There is no libocijdbc10.so under $ORACLE_HOME/lib, instead libocijdbc12.so is present. The OCI driver is not to using correct Oracle 12c library even when ojdbc8.jar is being configured to be used in the application.


STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. Set
LD_LIBRARY_PATH=$ORACLE_HOME/lib.

2. Configure ojdbc8.jar to be used by the application:

The CLASSPATH in Eclipse IDE used to run the application includes:
</classpathentry>
<classpathentry kind="lib" path="<DIR>/jdbc/lib/ojdbc8.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>


3. Try to establish the JDBC OCI connection.


Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.