Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The hierarchy of the type Classe is inconsistent

I have a class that implements an abstract class. The abstract class is in another package of my project. Added the package where the class is abstract by Configure build path/Project. In class that implements is accusing the following error: The hierarchy of the type class is inconsistent

Have I to add this package somewhere else?

Thank you!

like image 309
Deb Avatar asked Aug 29 '12 14:08

Deb


2 Answers

These errors happened because some interface/class in the hierarchy cannot be resolved. For example: the error is in your class - class X, X inherits Y, and in turn, Y inherits Z. However, the compiler cannot resolve z (in above error), because z is belong to a library that is not included. Therefore, you have to add package containing z to the classpath/ or project's Java Build Path (if you are using eclipse). hope it may help.

like image 195
Kasra Avatar answered Oct 10 '22 21:10

Kasra


Go to the Project Explorer.

  1. Right Click on your Project
  2. Build Path
  3. Configure Build Path
  4. Remove JRE System Library
  5. Click on Add Library
  6. Add JRE System Library
  7. Click on Next and then Finish

The errors will be resolved.

like image 26
Priyanka Naik Avatar answered Oct 10 '22 22:10

Priyanka Naik