Syntax error, annotations are only available if source level is 1.5 or greater老项目报错

因为项目是ssh 用的jdk版本是1.8以下

解决办法一

项目换低版本的jdk1.7

Syntax error, annotations are only available if source level is 1.5 or greater老项目报错

解决办法二

还是使用1.8,在项目中创建一个org.springframework.core包,在包下创建JdkVersion.java
spring-core.jar下就有JdkVersion.java

Syntax error, annotations are only available if source level is 1.5 or greater老项目报错

public static final int JAVA_18 = 5;

if(javaVersion.indexOf("1.8.") != -1{
  majorJavaVersion = 5;
}

Syntax error, annotations are only available if source level is 1.5 or greater老项目报错

上一篇:iPhone真机运行App提示“不再可用“(No Longer Available)的原因及解决


下一篇:解决No bean named ‘accountService‘ available错误