运行sqlcl的命令sql出错
bash-4.2$ sql username/password@hostname:1521:databasename
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)
解决办法 unset ORACLE_HOME
#/home/yourname/app/sqlcl/bin
vi sql
#add 'unset ORACLE_HOME' at line 501, just before the line of 'checkADE'
检查 sanity check
bash-4.2$ sql -version
SQLcl: Release 19.4.0.0 Production Build: 19.4.0.354.1736
参考