Forum Stats

  • 3,758,212 Users
  • 2,251,354 Discussions
  • 7,870,111 Comments

Discussions

UnsupportedClassVersionError: Bad version number in .class file

3862933
3862933 Member Posts: 15
edited Jan 31, 2019 3:10PM in SQLcl

Hello,

I have this issue when I try to run ./sqlcl/bin/sql:

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file

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

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

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

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

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

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

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

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

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

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

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

        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

My settings are:

Setting
Version
JavaJava(TM) SE Runtime Environment (build 1.8.0_131-b11)
SQLcl18.4.0.007.1818
JAVA_HOME/usr/java/jdk1.8.0_131/jre
ORACLE_HOME/opt/oracle/product/11.2.0.4/db_1
OSCENTOS 7

Regards,

Silva

Answers

  • Glen Conway
    Glen Conway Member Posts: 859 Gold Badge
    edited Jan 31, 2019 3:10PM

    This is happening because SQLcl is finding and using a lower version of Java than you indicate in your post, probably because sql script gives precedence to the JRE found in the ORACLE_HOME, as discussed in