Caused by: java.lang.UnsupportedClassVersionError: com/sumingk/platform/service/impl/ServiceSysPersonImpl : Unsupported major.minor version 51.0 (unable to load class com.sumingk.platform.service.impl.ServiceSysPersonImpl) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2892) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1172) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558) at org.springframework.util.ClassUtils.forName(ClassUtils.java:249) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:395) at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1349) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1320) ... 24 more
解决方案:
造成这种错误原因是的支撑Tomcat运行的JDK版本与支撑application运行的JDK版本不一致导致的.
把它们的JDK本改成一致步骤如下:
1.Window --> Preferences -->Java --> compiler中的compiler compliance level对应的下拉菜单中选择JDK版本.
2.Window --> Preferences -->MyEclipse --> Servers -->Tomcat --> Tomcat n.x -->JDK中的Tomcat JDK name下的下拉菜单中选择自身电脑上安装的JDK版本(必需与步骤1中的JDK版本一致).
要编译项目要确保:三点jdk必须一致
1.Window --> Preferences -->Java --> compiler
2.Window --> Preferences -->MyEclipse --> Servers -->Tomcat --> Tomcat n.x -->JDK
3.项目右键---->properties---->Java Build Path --->jdk 版本