当前位置:编程学习 > wap >>

The hierachy of the type (ClassName) is inconsistant.

昨天晚上到今天早上碰到一个让人抓狂的问题。

java error:

The hierachy of  the type (ClassName) is  inconsistant.

当时的理解是:类层级不一致。这就不叫扯淡了。

在网上搜了很久,第一,解释很少。第二,木有中文版的。

读了好多文档,理解了他们说的大致意思。大致是说比较上层的借口缺失。

这个比较靠谱。




Inconsistent hierarchy
From JavaErrors
Jump to: , 

You can get the error message

The hierarchy of the type Foo is inconsistent

if something in the hierarchy is broken. For example, if you have

WRONG


public abstract class Superclass implements NonExistentInte易做图ce { // inte易做图ce doesn't exist

// stuff

}

public abstract Foo extends Superclass {

// stuff

}

then you will get an error in Foo.java saying that the hierarchy of the type Foo is inconsistent.

This error will also be displayed if your imports are out of sync, perhaps caused by a re-build using an external builder like Ant. To remedy this, hit 'Refresh' (F5) on your Project in Eclipse's Package Explorer.

Another way to get this error in Eclipse is by running an Ant build that instantiates a hierarchy that is really a reference to another project. If the build fails (or was written incorrectly) the hierarchy is not cleaned up. I found I had to go to the Navigator tab (which shows the directories on disk - Windows/Show View/Navigator) and clean things up. Another way to clean it up, if you are running with source control, is to delete the project and bring it back (Thanks Subversion)

看是看懂了,可是这不是很扯淡吗?怎么会有这个问题那?

尝试了好多解决办法,还是木有作用,怎么办?

今天早上我突然想到,是不是自己在项目复制来复制去的时候,丢失了一些字节码,(估计恰好是关于Fragmentg的借口的),才造成了这个问题。于是我把项目删除,重新下载项目导入,哇偶,问题解决了。原来啊就是这个问题。

想了下,这其实还是eclipse的bug。建议eclispe能修复。

(本人比较懒,只帮助程序员解决中文论坛难以解决的问题)

android  wp  ios  开发。 

.net  wpf  wcf  wf  winforms    asp  开发。 

正在寻求“易做图“。

联系:

Q:3069217761.

msn:yalei.wang@hotmail.com
--------------------编程问答-------------------- 我也遇到了同样的问题报,The hierachy of  the type (ClassName) is  inconsistant.

原因楼主说的已经很清楚了,我的ECLIPSE报这个错的原因是,我修改了eclipse加载的工程路径的原因,比如我的eclipse加载的工程在C:\Users\IBM_ADMIN\Desktop\workingSpace\filesLu\svn,而我修改成了C:\Users\IBM_ADMIN\Desktop\workingSpace\filesLu\svn2,然后我发现报错,就把svn2修改为了svn,就是修改为何原来一样,可是还是报inconsistent的错误,最后发现这样修改知道导致jre环境丢失,于是我从新加载JRE环境,就解决这个问题了。 做法如下Bbuild path/config build path/Java Build Path/libraries/add libray/JRE Libray System/next /alternate JRE然后点击选择你的JRE的环境就可以了。 
补充:移动开发 ,  Android
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,