The solution to the Java @override error

Sometimes the Java Eclipse project will always report an @override error after compiling on a different computer. Just remove the @override, but it cannot fundamentally solve the problem, because sometimes there are too many places with @override.
This is a jdk problem. @Override is already available in JDK5, but the implementation of the interface is not supported. It is considered that this is not Override and an error is reported. JDK6 fixes this bug, and @Override can be added to both the method override of the parent class and the implementation of the interface.
To solve this problem, first make sure that jdk 1.6 is installed on the machine.
Then, select the eclipse menu Windows->Preferences-->java->Compiler-->compiler compliance level to select 1.6, refresh the project, and recompile.
If the problem has not been solved, right-click on the project where the error is reported, select Properties-->Java Compiler-->compiler compliance level, select 1.6, refresh the project, and recompile.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326166841&siteId=291194637