Eclipse:使用@Override时总是会注意到错误

hqt*_*hqt 13 java eclipse overriding intellij-idea

我不知道为什么每次实现一个类.当我使用@OverrideEclipse总是注意到错误:

类型B的方法A必须覆盖超类方法

(方法A是我覆盖的方法,B是我工作的当前类)

Eclipse建议删除 @Override

但是使用相同的代码,我在Idea上工作,没有发现错误.

请问谁可以告诉我原因.

谢谢 :)

@Edit:哦,我没有准确发布代码,因为当我实现某事时它会发生:例如:

public class helloworld implements Runnable {
    @Override //this line no-error with Idea and error with eclipse:the method run of type helloworld must be override a super class
    public void run(){
    }
Run Code Online (Sandbox Code Playgroud)

Vad*_*dim 8

Java 5仅在子类化时重写的方法上正确支持此注释.从Java 6开始,您还可以在从接口实现方法的方法上使用此批注.


man*_*_ak 5

检查您的合规性设置.它应该是JDK 6+