After importing a new project, find that the default JRE is version 1.5, right-click the project selection build in Eclipse path-> Click Configure Build Path->java build path-> Click JRE System After the library click on the edit->jdk1.8 version, click Finish, click OK.
But there is a Java file in the project that has a red fork, prompting to remove the override annotation. This problem is jdk1.5 version only, 1.6 version above has been resolved. In Eclipse, right-click the project selection build path->configure build path-> Click Java compiler-> Click Compiler Compliance level change from 1.5 to 1.8-> Click OK, click Yes in the Confirmation box that pops up, and the Red fork disappears.
It is important to note that the build path sets the JDK runtime environment and compiler sets the JDK compile-time environment, so they are best aligned.
@Override annotations compiling errors in eclipse