Oozie时出现Exception in thread "main" java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0?

  不多说,直接上干货!

  问题详情

[hadoop@bigdatamaster oozie-4.1.-cdh5.5.4]$ bin/ooziedb.sh create -sqlfile oozie.sql -run DB Connection

Oozie时出现Exception in thread "main" java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0?

[hadoop@bigdatamaster oozie-4.1.-cdh5.5.4]$ bin/ooziedb.sh create -sqlfile oozie.sql -run DB Connection
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx1024m" Validate DB Connection
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:)
at java.net.URLClassLoader.access$(URLClassLoader.java:)
at java.net.URLClassLoader$.run(URLClassLoader.java:)
at java.net.URLClassLoader$.run(URLClassLoader.java:)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:)
at java.lang.ClassLoader.loadClass(ClassLoader.java:)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:)
at java.lang.ClassLoader.loadClass(ClassLoader.java:)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:)
at org.apache.oozie.tools.OozieDBCLI.createConnection(OozieDBCLI.java:)
at org.apache.oozie.tools.OozieDBCLI.validateConnection(OozieDBCLI.java:)
at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:)
at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:)
at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:)

解决办法

  原因:

  1、jdk7+老版5.0驱动com/mysql/jdbc/Driver  (同时,多试试几个版本。mysql-connector-java-5.1.31-bin.jar  和 mysql-connector-java-5.1.21-bin.jar )
  2、jdk8+新版6.0驱动com/mysql/cj/jdbc/Driver

  对于这样的mysql驱动包,怎么去下载,建议去http://mvnrepository.com/。当然你也可以去CSDN资源里去。这里不多赘述

Oozie时出现Exception in thread "main" java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0?

Oozie时出现Exception in thread "main" java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0?

  mysql-connector-java-5.1..jar

 

  即可。

Oozie时出现Exception in thread "main" java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0?

  成功!

  然后呢,大家也许还会出现如下问题:

Oozie安装时放置Mysql驱动包的总结(网上最全)

Oozie时出现org.apache.oozie.service.ServiceException: E0103: Could not load service classes, Cannot load JDBC driver class 'com.mysql.jdbc.Driver'

Oozie时bin/oozied.sh start或bin/oozied.sh run出现Bootstrap进程无法启动,http://bigdatamaster:11000/oozie界面也无法打开?E0103: Could not load service classes,

java.lang.ClassNotFoundException: Class org.apache.oozie.ser

Oozie时bin/oozied.sh start或bin/oozied.sh run出现Bootstrap进程无法启动,http://bigdatamaster:11000/oozie界面也无法打开?

Oozie时出现Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure?

Oozie时出现Exception in thread "main" java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0?

CDH版本的oozie安装执行bin/oozie-setup.sh prepare-war,没生成oozie.war?

上一篇:Unsupported major.minor version 52.0 (unable to load class XXX


下一篇:schema for clojure