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