---
title: "The method of type must override a superclass method解决方式"
author: "xiaoyixiao"
date: "2015-04-02T11:51:02Z"
tags: ["JDK", "Java", "Myeclipse"]
categories: ["编程语言"]
slug: "the-method-of-type-must-override-a-superclass-method"
draft: false
lastmod: "2015-04-02T11:51:38Z"
id: 2198122
url: "https://xiaoyixiao.iteye.com/blog/2198122"
---

工程导入myeclipse时，出现问题提示：The method of type must override asuperclass? annotation：@Override的原因

查阅了一下资料，发现说在jdk1.5下要使用@Override 这个annotation 必须保证 被标注方法来源于class 而不是interface，

但我检查过，发现自己的jdk确实是1.6版本啊。

最后发现，即使自己的jdk是1.6，还需要修改myeclipse里面的编译jdk版本，从5.0改成6.0，要不就会出现上述错误。

修改路径是，在myeclipse下：Windows--Preferences--Java--Compiler，在右边的Compiler compliance level 修改版本为 6.0，就可以了    {Windows-&gt;Preferences-&gt;Java-&gt;Compiler  “configure project specific

settings”, Change from java 1.5 （5.0） to 1.6 （6.0） and then “yes” rebuild project。  这个要详细些，其实 跟前面一样}

 

此时，会发现 做了上面步骤，为啥还要报错，那是因为 导入的项目，还没把jre 变为6.0，解决办法为：项目右键-&gt;build path-&gt;configure build path-&gt;java Compiler(左边那排中) -&gt;在右边的Compiler compliance level 修改版本为 6.0

 

ok!!网上很多 博客 至少改了前面步骤， 后面改单独的项目的时候，确没说明，在此把这问题的解决办法整理出来，希望对新手有帮助，当然有什么不对的地方，希望大家指正

原文转自：

http://linhfgo.iteye.com/blog/1470996