`

The method of type must override a superclass method解决方式

阅读更多
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://lovelydd.blog.51cto.com/3759643/927419

今天做struts2上传文件的时候出现了这个问题:

The method execute() of type UploadAction must override or implement a supertype method


@Override 时出错误:


解决办法是:

一、                                                                      
因为你的Compiler 是jdk1.5,只要把它改为 1.6

方法: 

1. window ->preferences... -> java -> Compiler

2. Compiler compliance level : 6.0

二、 把项目的JRE变成6.0的
项目右键->build path->configure build path->java Compiler(左边那排中) ->在右边的Compiler compliance level 修改版本为 6.0                                                                                                                                     

三。 并且检查类名上是否继承了ActionSupport                                  

本文出自 “刘晨迪 ” 博客,请务必保留此出处http://lovelydd.blog.51cto.com/3759643/927419

分享到:
评论
1 楼 aaa6287152 2013-10-28  
感谢楼主 问题解决 一开始按照第一条修改了,结果看第二条没有修改,现在好了,十分感谢

相关推荐

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

    在Java编程语言中,"The method of type must override a superclass method" 是一个常见的错误提示,它通常出现在子类试图重写父类方法时,但没有按照正确的格式进行。这个错误通常与多态性和继承概念有关,是理解...

    java异常解决方案.docx

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

    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 ...

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

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

    ViewPager 放大缩小左右移动

    * Indicates that the pager is in the process of settling to a final * position. */ public static final int SCROLL_STATE_SETTLING = 2; private int mScrollState = SCROLL_STATE_IDLE; /** * ...

Global site tag (gtag.js) - Google Analytics