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

后端 未结 23 2631
遥遥无期
遥遥无期 2020-12-04 15:53

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 inc

23条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-04 16:51

    I was having this problem too... I found out that the hierarchy of the class that was throwing this exception, cannot be traced all way back to its root class by eclipse... I Explain:

    In my case, I have 3 java project: A, B and C... where A and B are maven projects and C a regular java eclipse project...

    In the project A, i have the interface "interfaceA" ... In the project B, i have the interface "interfaceB" that extends "interfaceA" In the project C, i have the concrete class "classC" that implements "interfaceB"

    The "project C" was including the "project B" in its build path but not "project A" (so that was the cause of the error).... After including "project A" inside the build path of "C", everything went back to normal...

提交回复
热议问题