Classe type hierarchy is incompatible

I have a class that implements an abstract class. The abstract class is in another package of my project. A package has been added in which the class is abstract by setting the build / project path. The following error is blamed on the class that implements: the hierarchy of the type class is incompatible

Can I add this package to another location?

Thank!

+5
source share
13 answers

These errors occurred due to the fact that some interface / class in the hierarchy cannot be resolved. For example: an error in the class X, X inherits Y and, in turn, Y inherits Z. However, the compiler cannot solve z (in the above error), since z belongs to a library that is not included. Therefore, you need to add the package containing z to the Java creation path or the project path (if you are using eclipse). hope this can help.

+34
source

This means that you made an incompatible change in the superclass, but did not recompile it.

I suggest you use a build system such as Maven or Ant, and / or use an IDE to create all of your code.

+5
source

.

  • JRE
  • " "
  • JRE
  • "" ""

.

+4

RCP.

: org.eclipse.core.runtime . , .

, Sid

+3

, , , , , .

+1

springframework.aop jar aopalliance.jar, , ur problm , , . ,

+1
right click your project ,Properties- java build path- source- include all the cs file source(it may inherit the files) and sync.

.

0

, - . - myClass extends pp1Class - , pp1Class . pp1Class pp2Class - pp1 ( proj1), . , , pp1, pp2, "Reexport this dependency" ( MANIFEST.MF). , .

0

, , , .classpath ( ).

, ClassB ClassA ClassA InterfaceA, LibraryA.jar. ClassA ProjectA, ClassB ProjectB. Project.classpath .

LibraryA.jar ProjectA. , - Eclipse, ( ), . - .classpath ProjectA, ( LibraryA.jar). - .

0

Eclipse, OSGi MANIFEST.MF- > Dependencies → Imported packages. . , ,

0

maven , Eclipse oxygen.1a, Eclipse oxygen.1a IDE,

MyClassName

,

SVN , Maven → Update Project Project Refresh.

...

, - .

0

jar , , - j2ee.jar , .

0

A

- jar , : "MethodBeforeAdvice"

MethodBeforeAdvice BeforeAdvice, jar, "Spring-aop-4.2.5.Release.jar".

"BeforeAdvice" "Advice", - jar "aop-alliance-1.0.0.jar", class-path

-1

All Articles