Java项目在Eclipse中,前几天都运行好好的,昨天下午新建了一个项目然后写了一个类运行了一下,运行的时候卡了一下,然后Eclipse中其他项目就报错,看样子是缺少jar包,但jar都在啊,怎么解决?
严重: Error configuring application listener of class com.cww.framework.session.ServletRequestListenerImpl java.lang.Error: Unresolved compilation problems: Syntax error, annotations are only available if source level is 1.5 or greater Syntax error, annotations are only available if source level is 1.5 or greater at com.cww.framework.session.ServletRequestListenerImpl.(ServletRequestListenerImpl.java:36) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:134) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) 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:662) 2016-5-6 10:11:46 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of class com.cww.framework.session.SessionListenerImpl java.lang.Error: Unresolved compilation problems: Syntax error, annotations are only available if source level is 1.5 or greater Syntax error, annotations are only available if source level is 1.5 or greater at com.cww.framework.session.SessionListenerImpl.(SessionListenerImpl.java:45) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:134) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) 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:662) 2016-5-6 10:11:46 org.apache.catalina.core.StandardContext listenerStart
严重: Error configuring application listener of class com.cww.framework.session.SessionBindingChecker java.lang.Error: Unresolved compilation problems: Syntax error, parameterized types are only available if source level is 1.5 or greater Syntax error, parameterized types are only available if source level is 1.5 or greater Syntax error, annotations are only available if source level is 1.5 or greater Syntax error, annotations are only available if source level is 1.5 or greater Syntax error, annotations are only available if source level is 1.5 or greater at com.cww.framework.session.SessionBindingChecker.(SessionBindingChecker.java:39) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:134) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) 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:662) 2016-5-6 10:11:46 org.apache.catalina.core.StandardContext listenerStart
发异常信息,要不没法看。信息贴上去了帮忙看下
<spanstyle="font-family:'MicrosoftYaHei',Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">annotationsareonlyavailableifsourcelevelis1.5orgreateratcom.cww.framework.session.ServletRequestListenerImpl
<spanstyle="font-size:14px;line-height:22px;background-color:#FFFFFF;">创建项目的时候,选择的版本跟以前项目的版本不一样,一般都是选低了。你删除项目重新创建一个吧。环境要选对了。
<spanstyle="font-size:14px;line-height:22px;background-color:#FFFFFF;"><imgsrc="http://static.oschina.net/uploads/space/2016/0506/110213_WBhD_1419305.png"alt="">
可以手动改项目的Level的。
Project->javecompiler你把Level选成自己定义类型。
再者可以保持和WorkspaceLevel一致。(我常常这么做)
编译使用的java版本太低版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。