I. Problem descriptionSyntax error, annotations are only available if source level is 1.5 or greater, indicating that the annotations are only available in jdk1.5 or higher, as shown in the figure below:
My JDK is configured to be 1.8, which is not supposed to be the case. I checked the configuration of my project and found the problem
Second, the cause of the problem
The compiler followed a low compilation level, used the default configuration file at project creation time, and did not update as configured with the JDK version
Here is the configuration information for the configuration file:
3. Solutions
1. Click the project shortcut Alt + Enter or right-click the project and select Properties at the bottom to enter the project configuration page
2. Modify the compilation level of the compiler
3. Change the configuration
4. The configuration file was modified successfully
Ok, problem solved
Read More:
- “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
- Eclipse .java File Syntax error, parameterized types are only available if source level is 1.5 or
- How to solve the problem of “version 11 or greater is required” in eclipse 2020
- Start eclipse and prompt version 1.7.0_ 79 of the JVM is not suitable for this product. Version: 1.8 or greater i…
- Annotations are not allowed here
- [Solved] error: Microsoft Visual C++ 14.0 or greater is required
- Version 1.8.0_201 of the JVM is not suitable for this product. Version: 11 or greater is required.
- After eclipse eclipse eclipse imports the correct project, an error is reported in XML and other files
- When using ionic to build Android APK, Cordova error is reported: requirements check failed for JDK 1.8 or greater
- Diamond types are not supported at this language level appears in IntelliJ
- Wrong classification of Python — assertion cur_ Target is greater than or equal to 0 and cur_ Target is less than n_ classes failed
- Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools“
- Error: (44,73) lambda expression and XML are not supported in Java: – source 1.7 Error:java : Compilation failed
- Error in Maven packaging web project: webxml attribute is required (or pre existing WEB-INF)/ web.xml if executing in update)
- QuartusII software exception: error: top level design entity “” is undefined
- Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and co
- Hzero – if the local swagger fails to register, the connection timeout or gateway error will be displayed
- Access restriction in Eclipse: the type ‘xxx’ is not API solution