Eclipse @override Error Resolution
Keyword: Eclipse @override error Resolution
The first of these solutions:
@Override is JDK5 , but there is a small bug, is not support the implementation of the interface, that this is not an override
and JDK6 fixed this bug, whether the method of the parent class overrides or the implementation of the interface can be added @override
Modify your eclipse-specific compiler version
Specify a version at least 5.0 in the Java compiler option
The method of changing the compiler in MyEclipse: Project->properties->java compiler->configure Workspace Setting, can be set in the popup page.
This is from:http://blog.csdn.net/CodeJoker/archive/2009/07/02/4317361.aspx
Second Solution: (I use this method, no problem)
The use of @override in Java 1.5 and 1.6 is somewhat different, although the JRE has been changed, but eclipse will still make an error.
WORKAROUND: Windows->preferences-->java->compiler-->compiler compliance level is set to 1.6 OK.
Attention:
However, when importing a project, the Java.lang.UnsupportedClassVersionError:Bad version number in. class file exception is found after compiling and packaging to Tomcat. Checking my myeclipse, I found that the JDK version of my eclipse's compiler was inconsistent with the JDK version used by Tomcat, which was later set to match. It seems as if this problem has been caused.
The deployment of the project on Linux also appeared because of different versions of the problem, when we used the IDE compiler is JDK5.0, and that Linux installed is JDK6.0, after deployment found a lot of functions are wrong, it seems that some things still pay attention to AH.
Attached, the method of changing the compiler in MyEclipse: Project->proper ties->java compiler->configure Workspace Setting, can be set in the popup page
In fact, this kind of way is similar to the second one. The first way to focus is to set up this project. The second focus is on all of the items. But it can all be used.
Eclipse @override Error Resolution