java.lang.UnsupportedClassVersionError: com/mysql/cj/jdbc/Driver : Unsupported major.minor version 5

原因:
com/mysql/cj/jdbc/Driver是6.0版本的驱动,兼容JDK8环境,不兼容JDK7环境,在基于jdk7的tomcat中编译运行会出错,在基于jdk8的tomcat中编译运行则不会出错。

解决方案:
1、jdk7+老版5.0驱动com/mysql/jdbc/Driver
2、jdk8+新版6.0驱动com/mysql/cj/jdbc/Driver

原文地址:https://www.cnblogs.com/GH0522/p/9328416.html

时间: 2025-01-09 06:00:15

java.lang.UnsupportedClassVersionError: com/mysql/cj/jdbc/Driver : Unsupported major.minor version 5的相关文章

【原创】Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0

有多个情况造成这种异常,以下列举 1.JDK 和 MAVEN 版本不兼容 从apache 官网下载maven bin 版本,我下的是apache-maven-3.3.3-bin.zip. 下载下来的安装包解压到你的工作目录下.如:E:\开发\apache-maven-3.3.3,配置环境变量,MAVEN_HOME,再把%MAVEN_HOME%\bin配置到 path中. 安装java jdk,配置JAVA_HOME.打开cmd ,输入mvn -r,如果会报错.java.lang.Unsuppor

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0

me 的 maven 项目, 右键 update dependencies , 出现 错误 Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.la

java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0解决办法

androidstudio编译程序时出现java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0.Unsupported major.minor version 52.这个错误是由于(jdk)高版本的java project使用了低版本的来运行.使用命令(java -version 和 javac -version)查看java

MyEclipse配置tomcat报错 - java.lang.UnsupportedClassVersionError: org/apache/lucene/store/Directory : Unsupported major.minor version 51.0

1 开发Servlet程序时,MyEclipse配置好tomcat与JDK之后,启动时控制台报下列错误: 1 java.lang.UnsupportedClassVersionError: org/apache/lucene/store/Directory : Unsupported major.minor version 51.02 at java.lang.ClassLoader.defineClass1(Native Method)3 at java.lang.ClassLoader.de

java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0

版本为: jdk1.7.0_80 mysql-connector-java-5.1.46-bin.jar 解决办法: 升级JDK或者降级MySQL Connector/J为mysql-connector-java-5.1.46-bin.jar java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0 at java.lang.ClassLoader.de

java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver

java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) at java

Android java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor ver

java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor ver 解决办法: 把compile sdk version与Build tool version改成对应的. 之后在clean ,rebuild.

Tomcat - java.lang.UnsupportedClassVersionError:Unsupported major.minor version 51.0 (unable to load class com.microsoft.sqlserver.jdbc.SQLS

今天使用Tomcat连接sql Server 2008 enterprise的时候,报错: HTTP Status 500 - Servlet execution threw an exception type Exception report message Servlet execution threw an exception description The server encountered an internal error that prevented it from fulfil

java.lang.UnsupportedClassVersionError: xxx/xxxClass : Unsupported major.minor version 51.0

完全参考自 http://www.cnblogs.com/xing901022/p/4172410.html 这种错误的全部报错信息: 1 java.lang.UnsupportedClassVersionError: org/apache/lucene/store/Directory : Unsupported major.minor version 51.0 2 at java.lang.ClassLoader.defineClass1(Native Method) 3 at java.la