Eclipse compilation error: The hierarchy of the type 'Class name' is inconsistent

I have downloaded some open source software written in Java and tried to compile it using Eclipse. I got the error: "The hierarchy of the type 'Class name' is inconsistent" in some files. What causes these errors and how do I fix them?


It means you are trying to implement a non-existing interface or you're extending an non-existing class.

Try to refresh your Eclipse.

If it doesn't work, it may mean that you have a reference to a JAR that is not in the build path. Check your project's classpath and verify that the jar containing the interface or the class is in it.


Sometimes it happens when you add a jar that YOU need, but don't include the jars that IT needs. In my case adding all the jars in tomcat/lib helped me to solve this problem. I am working on a web-app.