Solution 1:
@ Override is already available in JDK 5, but there is a small bug that does not support interface implementation.
JDK 6 fixes this bug. You can add @ override to both the method override of the parent class and the implementation of the interface.
Modify the compiler version specified by your eclipse
In the Java compiler option, the specified version must be at least 5.0.
In myeclipse, change the compiler method: Project-> properties-> Java compiler-> Configure workspace setting, which can be set on the pop-up page.
This comes from: http://blog.csdn.net/CodeJoker/archive/2009/07/02/4317361.aspx
Solution 2: (no problem if I use this method)
In Java 1.5 and 1.6, @ override is used differently. Although JRE is changed, eclipse still reports an error.
Solution: Windows-> preferences --> JAVA-> compiler --> compiler compliance level is set to 6.0.
Note:
However, when importing a project, compile and package it into tomcat, you will find that Java. lang. unsupportedclassversionerror: bad version number in. class file exception. Check my myeclipse. I found that the JDK version of my eclipse compiler is inconsistent with that of Tomcat, and set it to be consistent later. It seems that this problem is caused.
During the deployment of the project on Linux, there were also problems caused by different versions. At that time, the IDE compiler we used was jdk5.0, And the Linux server was installed with jdk6.0, after deployment, I found that many functions were faulty. It seems that I have something to pay attention.
Appendix: how to change the compiler in myeclipse: Project-> ties of proper-> Java compiler-> Configure workspace setting. You can set it on the pop-up page.
Note: QQ technology exchange group: add one if you are interested in 108614806.