运行项目报错 java.lang.UnsupportedClassVersionError: XXX: Unsupported major.minor version 51.0

Win7下使用Tomcat7+JDK1.6环境运行项目,项目开发使用JDK1.7,运行项目报错,错误如下

严重: Exception starting filter struts2
java.lang.UnsupportedClassVersionError: XXX: Unsupported major.minor version 51.0 (unable to load class XXX)

开发项目使用的JDK版本和项目运行服务器JDK版本不同就会出现上面的问题。修改JDK版本使两者保持一致即可。

可调整系统环境变量JAVA_HOME或者修改开发环境的JAVA编译器Java Compiler

 

 

 

 

 

 

 

java.lang.UnsupportedClassVersionError: org/apache/struts2/dispatcher/filter/StrutsPrepareAndExecuteFilter : Unsupported major.minor version 51.0 (unable to load class org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter) at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3200) at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1373) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1861) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4958) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5652) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)
©️2020 CSDN 皮肤主题: 酷酷鲨 设计师:CSDN官方博客 返回首页