[Solved] Porject Error: Syntax error, annotations are only available if source level is 1.5 or greater

Because the project is SSH, the JDK version used is less than 1.8

Solution 1

Project upgrade to jdk1.7

Solution 2

Still use 1.8 to create an org.springframework.core package in the project, and create jdkversion. Java under the package

There is jdkversion.java under spring-core.jar

public static final int JAVA_18 = 5;

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

Similar Posts: