`
123003473
  • 浏览: 1069469 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

@Override must override a superclass method 问题解决 .

 
阅读更多
1.Java开发环境时

如果在使用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。




2.Android开发环境时

有时候从已有Android工程导入到Eclipse后,编译会报这个错误。

这时候需要在工程上右键,->Properties->Java Compiler(Left panel)->Compiler compliance level修改到相应版本,比如1.6之类(如果1.7时编译出错)。

【转载地址】http://blog.csdn.net/forlong401/article/details/7696625

分享到:
评论

相关推荐

    The method of type must override a superclass method解决方式, myeclipse, java, web

    在阅读《The method of type must override a superclass method.docx》文档时,你应该能找到具体的例子和解决方案,文档可能包含了详细的代码示例以及如何在MyEclipse中进行调试和修复的步骤。 总之,理解并正确...

    java异常解决方案.docx

    * java.lang.Error: Unresolved compilation problem: The method contextInitialized(ServletContextEvent) of type CreateDataSourceTableListener must override a superclass method + 解决方案:检查 Servlet ...

    关于java编译过程中的bug说明

    must override a superclass method",并提供相应的解决策略。 这个错误通常发生在尝试覆盖父类的一个方法,但是Java编译器发现该方法的签名并不符合Java的多态性规则。在Java中,子类重写父类的方法时,必须保持...

    ViewPager 放大缩小左右移动

    * stub implementations of each method. Extend this if you do not intend to * override every method of {@link OnPageChangeListener}. */ public static class SimpleOnPageChangeListener implements ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    On the other hand, you must include the header file for Foo if your class subclasses Foo or has a data member of type Foo. Sometimes it makes sense to have pointer (or better, scoped_ptr) members ...

Global site tag (gtag.js) - Google Analytics