Forum Stats

  • 3,815,372 Users
  • 2,259,010 Discussions
  • 7,893,059 Comments

Discussions

Version 22.1.0.90.1611 - April 5, 2022

User_V0ZJV
User_V0ZJV Member Posts: 3 Green Ribbon

How to overcome this?


C:\Users>C:\Apps\sqlcl\sqlcl\bin\sql.exe /nolog

Error: A JNI error has occurred, please check your installation and try again

Exception in thread "main" java.lang.UnsupportedClassVersionError: oracle/dbtools/raptor/scriptrunner/cmdline/SqlCli has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

    at java.lang.ClassLoader.defineClass1(Native Method)

    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)

    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

    at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)

    at java.net.URLClassLoader.access$100(URLClassLoader.java:74)

    at java.net.URLClassLoader$1.run(URLClassLoader.java:369)

    at java.net.URLClassLoader$1.run(URLClassLoader.java:363)

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

    at java.net.URLClassLoader.findClass(URLClassLoader.java:362)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)


C:\Users>java -version

java version "1.8.0_321"

Java(TM) SE Runtime Environment (build 1.8.0_321-b07)

Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)

Best Answers

Answers

  • User_H3J7U
    User_H3J7U Member Posts: 1,058 Gold Trophy
    Answer ✓

    Release Notes

    JRE Support

    SQLcl release 22.1 requires Oracle Java version 11 or 17.


  • User_V0ZJV
    User_V0ZJV Member Posts: 3 Green Ribbon

    Hello

    Thanks

    I set JAVA_HOME to Java 17


    But Some problems with jdbc

    In command -

     connect ...

    Error report -

    Connection Failed

     URL      = jdbc:oracle:oci8:@xxxxx

     Error Message = Incompatible version of libocijdbc[Jdbc:214000, Jdbc-OCI:213000

     URL      = jdbc:oracle:thin:@xxxxx

     Error Message = IO Error: The Network Adapter could not establish the connection (CONNECTION_ID=+xQIpUrHRueEulfEBldK7w==)



    So I copy ojdbc8.jar to ojdbc11.jar in lib directory.

    And works fine.

  • User_H3J7U
    User_H3J7U Member Posts: 1,058 Gold Trophy
  • Yevon
    Yevon Member Posts: 108 Blue Ribbon
    edited May 4, 2022 9:07PM

    What is the solution to this error?


     Error Message = Incompatible version of libocijdbc[Jdbc:214000, Jdbc-OCI:213000


    I came across with it but any answer yet, we need this working without workarrounds.

  • User_H3J7U
    User_H3J7U Member Posts: 1,058 Gold Trophy

    Use a thin connection or Oracle Client 21.4

  • Yevon
    Yevon Member Posts: 108 Blue Ribbon

    Oracle client 21.3 is latest version for windows. I don't understand why sqlcl and sqldeveloper are released with greater versions than the instant client. 21.3+ is only available under linux. Thin client doesn't work with wallet auth. What files did you replace to get this working? I tried to find the ojdbc8.jar but I coudn't find it in latest versions of sqlcl sqldeveloper or instant client.

  • User_H3J7U
    User_H3J7U Member Posts: 1,058 Gold Trophy

    Thin client doesn't work with wallet auth.

    Set the jdbc property oracle.net.wallet_location.

    D:\> mkstore -wrl d:\ow -createCredential localhost:1521/pdb213a.vm user1
    D:\> set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 -Duser.language=en -Doracle.net.wallet_location=d:\\ow
    D:\> sql /@localhost:1521/pdb213a.vm
    
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Duser.language=en -Doracle.net.wallet_location=d:\\ow
    SQLcl: Release 22.1 Production on Tue Jan 19 03:14:07 2038
    Copyright (c) 1982, 2022, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
    Version 21.3.0.0.0
    
    SQL> show connection
    CONNECTION:
     [email protected]:oracle:thin:@localhost:1521/pdb213a.vm
    CONNECTION_IDENTIFIER:
     localhost:1521/pdb213a.vm
    CONNECTION_DB_VERSION:
     Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
     Version 21.3.0.0.0
    NOLOG:
     false
    PRELIMAUTH:
     false
    


    Yevon
  • Yevon
    Yevon Member Posts: 108 Blue Ribbon

    mmm nice! I will try this and comment results, thanks a lot!

  • Yevon
    Yevon Member Posts: 108 Blue Ribbon

    Oh god, worked like a charm, I owe you another! I already had "-Dfile.encoding=UTF-8 -Duser.language=en", but I had missing the wallet location.