Forum Stats

  • 3,758,942 Users
  • 2,251,479 Discussions
  • 7,870,440 Comments

Discussions

SQLcl errors with Unsupported major.minor version 52.0 on linux with JAVA_HOME and java -version set

1695545
1695545 Member Posts: 9
edited Apr 11, 2019 1:56PM in SQLcl

[email protected]:/home/oracle/sqlcl/bin> echo $JAVA_HOME

/home/oracle/oem/JDK18/jdk1.8.0_171

[email protected]:/home/oracle/sqlcl/bin> java -version

java version "1.8.0_171"

Java(TM) SE Runtime Environment (build 1.8.0_171-b11)

Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

[email protected]:/home/oracle/sqlcl/bin> ./sql

Exception in thread "main" java.lang.UnsupportedClassVersionError: oracle/dbtools/raptor/scriptrunner/cmdline/SqlCli : Unsupported major.minor version 52.0

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

        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)

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

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

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

        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

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

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

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

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

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

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

Could not find the main class: oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.  Program will exit.

«1

Answers

  • 1695545
    1695545 Member Posts: 9
    edited Apr 4, 2019 2:43PM

    First time install/config of SQLcl on linux using 18.4 download.

  • Glen Conway
    Glen Conway Member Posts: 859 Gold Badge
    edited Apr 4, 2019 3:31PM

    If you have an ORACLE_HOME set, then sqlcl uses the Java installed there.  Here are some other recent discussions for this issue:

    sqlcl 18.4 unsupported major.minor number 52.0

    sqlcl java errors under different db homes

    Cheers

  • 1695545
    1695545 Member Posts: 9
    edited Apr 5, 2019 12:08PM

    I downloaded and installed sqlcl 18.4, 18.3, 18.2 all failed with same errors.  I finally downloaded and installed 17.4 and it cranked up with $JAVA_HOME, $PATH, and $ORACLE_HOME all set.

    I dont believe the problem is with me or my environment.

    Also, I decided to switch to sqlcl in an effort to generate a csv file.

    set sqlformat csv

    takes so long to write to the file compared to sqlplus.  In sqlplus, i set arraysize to 5000 but cant find directions on equivalent here. Still searching.

  • Andris Perkons-Oracle
    Andris Perkons-Oracle Posts: 1,099 Employee
    edited Apr 5, 2019 1:29PM
    I dont believe the problem is with me or my environment.

    I don't think it's a general problem (so yes, I guess it's something on your system/in your environment).

    On my Linux systems, everything works just fine with sqlcl 18.4:

    $ java -versionjava version "1.8.0_171"Java(TM) SE Runtime Environment (build 1.8.0_171-b11)Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)$ ./sqlSQLcl: Release 18.4 Production on Fri Apr 05 19:17:41 2019Copyright (c) 1982, 2019, Oracle.  All rights reserved.Username? (''?) sys as sysdbaPassword? (**********?) ********Connected to:Oracle Database 18c Express Edition Release 18.0.0.0.0 - ProductionVersion 18.4.0.0.0

    In the above example, I have set PATH to point to the jdk that came with the Oracle installation (XE 18c). sqlcl works with or without JAVA_HOME set.

    My XE 11 system has OpenJDK installed and also works fine with sqlcl 18.4:

    $ java -versionopenjdk version "1.8.0_121"OpenJDK Runtime Environment (build 1.8.0_121-b13)OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)$ ./sqlSQLcl: Release 18.4 Production on Fri Apr 05 19:24:28 2019Copyright (c) 1982, 2019, Oracle.  All rights reserved.Username? (''?) sys as sysdbaPassword? (**********?) ********Connected to:Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

    Andris

  • 1695545
    1695545 Member Posts: 9
    edited Apr 5, 2019 1:40PM

    Oracle installation (XE 18c)??  Huh??  What is this?  We're running 12cR1 RAC.

  • 1695545
    1695545 Member Posts: 9
    edited Apr 5, 2019 1:43PM

    Yep.  Here's our banner: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

  • 1695545
    1695545 Member Posts: 9
    edited Apr 5, 2019 1:48PM

    Also, real quick.

    Do you know how to set the equivalent to arraysize for my version of sqlcl?

    I do see the higher versions of the Database Server (12cR2) and sqlcl have simple commands like:

    SET LOBPREF[ETCH], SET ROWPREF[ETCH], and SET STATEMENTC[ACHE].

  • 1695545
    1695545 Member Posts: 9
    edited Apr 5, 2019 1:51PM

    One more thing.  I was able to get 18.4 sqlcl to work under my windows after "yanking in/out" my JDK.  However, not able to get it to run under cygwin.

  • Andris Perkons-Oracle
    Andris Perkons-Oracle Posts: 1,099 Employee
    edited Apr 5, 2019 1:53PM
    Oracle installation (XE 18c)??  Huh??  What is this?

    Never heard about Oracle DB Express Edition?

    Anyway, I don't have 12.1 handy, but sqlcl 18.4 also connects to my 12.2 database.

  • Glen Conway
    Glen Conway Member Posts: 859 Gold Badge
    edited Apr 5, 2019 3:46PM

    Both sqlplus and sqlcl support arraysize -

    Capture.JPG

    although there may be differences in behavior between sqlplus and sqlcl.  For example:

    https://asktom.oracle.com/pls/apex/f?p=100:11:::NO::P11_QUESTION_ID:9536898000346341597