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:
- How to Solve JAVA @override error
- @Override must override a superclass method problem solving
- [Solved] Syntax error, parameterized types are only available if source level is 1.5
- java.lang.UnsupportedClassVersionError: Bad version number in .class file
- How to Solve Error starting modern compiler
- What are the reasons for the faceted project problem in Java Web project
- The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class
- Invalid use of incomplete type struct or class solution
- An error is reported after eclipse changes the JDK version
- [IDEA] Maven Run Project Error: Diamond operator is not supported in – source 1.5″