在eclipse中导入工程后@Override报错

来源:互联网 发布:linux 破解root 编辑:程序博客网 时间:2024/04/30 11:25

导入工程后,所有的@Override都报如下错误:

Multiple markers at this line
 - The method getCount() of type new BaseAdapter(){} must override a superclass
  method


百度中的结果的是:很多时候导入android项目在eclipse中会报@Override错误,这是由于java编译器版本不正确,这是由于java编译器的版本不正确,Java 1.5的编译器默认对父类的方法进行覆盖,采用@Override进行说明;但1.6已经扩展到对接口的方法;所以如果还是以Java 1.5的编译器来编译的话,会出现错误。

在eclipse中 选择Window –> Preferences –> Java –> Compiler 选择1.6 ,如果还不可以,在Compiler中选择onfigure Project Specific Settings 选择编译器版本为1.6     


1.Configure Project specific Settings 指定你的项目 ,Compiler compiance leven 也设置为1.6,

或者右击你的项目  Properties -->JAVA Compiler  Compiler compiance leven 设置为1.6


2.

0 0
原创粉丝点击