简体   繁体   中英

eclipse errors when calling methods of imported abstract classes or interfaces from different project

I've just downloaded a large project from source control which includes multuple projects-as I've done before without trouble. Usually the class depencies are already defined and I can import the packages into eclipse without difficulty.

This time I seem to have difficulty with communication between projects. All my errors seem to be due to classes extending/implementing abstract classes or interfaces. If class A in one project extends or implements another class or interface from another project I end up getting exceptions when class A tries to call or override inherited methods. I've checked the build path and it seems correct, and I'm able to import the abstract class and interfaces, just not use methods from them. The issues only occur when the interface or class being implemented exists in a different package then the class implementing it.

I've tried refreshing the packages, cleaning and rebuilding, and doing a rebuild from the ant scripts, none of these changes seemed to help. Can anyone suggest what may be wrong?

Incidentally when I checked out everything from source control I think I may have gotten some of the eclipse metadata which had been checked in by mistake; which may explain how eclipse got in an inconsistent state.

Thanks!

If you are compiling fine but getting ClassNotFoundExceptions at runtime, you need to make sure what's visible in the Classpath tab of your Run Configurations matches your Project's build path.

This will ensure you are running with the same classpath you are building with.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM