天天看點

@Override must override a superclass method 問題

在eclipse導入android項目的時候,出現:

The method run() of type new Runnable(){} must override a superclass method

提示需要 remove '@Override' annotation 

網上找了一下解決辦法,主要是jdk版本問題:

如果出現  The method *** of type *** must override a superclass method

右鍵項目屬性》javaCompiler中的complier compliance level 将1.5 改為1.6。

也可以在window》preferences》java》compiler中的Compiler compliance level 修改為1.6。

如果在使用Eclipse開發Java項目時,在使用 @Override 出現以下錯誤:

The method *** of type *** must override a superclass method

主要是因為你的Compiler是jdk5,(5不支援@Override等形式的批注)隻要把它改為6就可以了。

方法:将window->preferences->java-compiler中的Compiler compliance level修改為6.0。