JDK版本导致的报错:Unsupported major.minor version 52.0

今天遇到一个问题,具体报错如下

java.lang.UnsupportedClassVersionError: com/oa/commons/listener/MyHttpSessionListener : Unsupported major.minor version 52.0 (unable to load class com.oa.commons.listener.MyHttpSessionListener)
	at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3255)
	at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1420)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1924)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1798)
	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:536)
	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:518)
	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:148)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5113)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5720)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1707)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1697)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

查询后具体的原因是工作空间是JDK8,而项目需要用JDK7,导致的Tomcat启动报错,特在此记录此次错误,留作标记

附:

JDK对照

JDK 8.0 = 52,
JDK 7.0 = 51,
JDK 6.0 = 50,
JDK 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45

 

你可能感兴趣的:(工具类)