JAVA: How to Solve @override error

Sometimes, when the MyEclipse project of Java is compiled on another computer, the @override always reports an error. Just remove the @override, but it can not fundamentally solve the problem, because sometimes there are too many @override places

[size=18.0180187225342px]        This is a problem with the JDK itself, @override is already available in jdk5, but it does not support the implementation of the interface, that is, when using @override, its parent class must be a class, not an interface, otherwise an error will be reported. JDK6 has corrected this bug, and @override can be added to both the method override of the parent class and the implementation of the interface

[size=18.0180187225342px]        To solve this problem, first ensure that JDK 1.6 is installed on the machine, and then select the MyEclipse menu windows – > Preferences–> java-> Compiler–> Compiler compliance level select 1.6, refresh the project and recompile

[size=18.0180187225342px]          If the problem has not been solved, right-click on the error reporting project and select properties — > Java Compiler–> Select 1.6 from compiler compliance level, refresh the project and recompile


Similar Posts: