libocijdbc11.so: wrong ELF class: ELFCLASS64 ELFCLASS32 (Doc ID 301956.1)

Last updated on AUGUST 03, 2016

Applies to:

JDBC - Version 11.1.0.6 and later
Information in this document applies to any platform.
***Checked for relevance on 22-Jan-2014***

Symptoms

This note explains the reason for the following error messages:

java.lang.UnsatisfiedLinkError: libocijdbc11.so: wrong ELF class: ELFCLASS32
java.lang.UnsatisfiedLinkError: libocijdbc11.so: wrong ELF class: ELFCLASS64


Example:

/usr/java/jre1.6.0_17/bin/java -cp $ORACLE_HOME/jdbc/lib/ojdbc6.jar:. Class1
Exception in thread "main" java.lang.UnsatisfiedLinkError: /u01/app/oracle/product/11.2.0/dbhome_3/lib/libocijdbc11.so: /u01/app/oracle/product/11.2.0/dbhome_3/lib/libocijdbc11.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3551)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3547)
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)

 

Older clients such as 9i or 10g may get the following errors:
libocijdbc9.so: wrong ELF class: ...
libocijdbc10.so: wrong ELF class: ...

 

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