Forum Stats

  • 3,838,748 Users
  • 2,262,397 Discussions
  • 7,900,749 Comments

Discussions

libocijdbc11.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)

User_U1UYA
User_U1UYA Member Posts: 27 Red Ribbon
edited Apr 4, 2022 4:06AM in Oracle Call Interface (OCI)

Hi all,

I am running the sample JDBCversion.java and running into this error below.

In /u01/app/oracle/product/11204E/oui/oraparam.ini, JRE_MEMORY_OPTIONS is already -d64.

JRE_MEMORY_OPTIONS=" -d64 -mx150m"

Environment variables:

export PATH=$PATH:/u01/app/oracle/product/11204E/jdk/bin

export CLASSPATH=$ORACLE_HOME/jdbc/lib/ojdbc5.jar:$ORACLE_HOME/jlib/orai18n.jar


Error below:

Exception in thread "main" java.lang.UnsatisfiedLinkError: 

/u01/app/oracle/product/11204E/lib/libocijdbc11.so: ld.so.1: java: /u01/app/oracle/product/11204E/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(ClassLoader.java:1753)

    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1678)

    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:3541)

    at java.security.AccessController.doPrivileged(Native Method)

    at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3537)

    at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:269)

    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)

    at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:165)

    at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)

    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)

    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 JDBCVersion.main(JDBCVersion.java:11)


PROGRAM BELOW:

import java.sql.*;

import oracle.jdbc.*;

import oracle.jdbc.pool.OracleDataSource;


class JDBCVersion

{

 public static void main (String args[]) throws SQLException

 {

  OracleDataSource ods = new OracleDataSource();

  ods.setURL("jdbc:oracle:oci:xxx/[email protected]:9999:xxx");

  Connection conn = ods.getConnection();


  // Create Oracle DatabaseMetaData object

  DatabaseMetaData meta = conn.getMetaData();


  // gets driver info:

  System.out.println("JDBC driver version is " + meta.getDriverVersion());

 }


Please help to shed some lights in this issue


Thanks


A friend