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

后端 未结 23 2508
遥遥无期
遥遥无期 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:29

    I 've experienced this problem on Eclipse Juno, the root cause was that although some spring jars were being included by transient maven dependencies they were included in incorrect versions.

    So you should check if using a modularized framework as spring that every module (or at least the most important: core, beans, context, aop, tx, etc.) are in the same version.

    To solve the problem I 've used maven dependnecy exclusions to avoid incorrect version of transient dependencies.

    0 讨论(0)
  • 2020-12-04 16:29

    If the extended class has the issue then the above error message will gets displayed.

    Example

    class Example extends Example1 {
    
    }
    

    fix the issues in Example1

    0 讨论(0)
  • 2020-12-04 16:30

    I had this problem after I upgraded the JDK to a new version. I had to update the references to libraries in Project Properties/Java Build Path.

    0 讨论(0)
  • 2020-12-04 16:30

    When importing a GWT project in Eclipse without installing "Google Plugin for Eclipse", this will occur. After installing "Google Plugin for Eclipse", this error will disappear.

    0 讨论(0)
  • 2020-12-04 16:31

    Right click on the project folder and select "Java Build Path". Under "Java Build Path" you should be able to see libraries. Eclipse will show errors in any of those libraries. Fixing those issue will help to resolve the issue.

    0 讨论(0)
  • 2020-12-04 16:33

    One more case I have had. Give the correct project path, and import it to eclipse.

    Then go to Project--> Clean --> Clean all projects.

    0 讨论(0)
提交回复
热议问题