tags:

views:

80

answers:

3

I am developing a Java project using Eclipse. The project uses another project called engine, which I have added in my project build-path. As I need to call a dabo class, called House, in one of my project class, named Window, I have used the following code as usual:

import ee.asus.kernel.House;

I got however the following error in compiling time:

Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
The import ee cannot be resolved
House cannot be resolved to a type
House cannot be resolved to a type
House cannot be resolved to a type

at main.ee.asus.GUI.FrameWindow.Window.<init>(Window.java:10)
at main.ee.asus.GUI.StartApplication.main(StartApplication.java:13)

It's worth to point out that my prject and the dabo project use the same directory/packages names. Does anyone have a clue where the error may be?

A: 

The error can't resolve the first part of the package name: ee. Are you sure the package starts with ee? I see your Window class package starts with main.ee, does your engine project start with the same package structure?

Ross
By adding *main* it will throw the error:The import main.ee.asus.kernel.House cannot be resolved
Tony
Strange, if the engine project is added in your projects build path and the package name is the same as it is defined your House class it should work. Only reason I can think of is if your engine project has compile errors as well
Ross
A: 

Look for the House class in your second project, opens it and see what package it is in.
(line "package xxx.yyy.zzz;" at the beginning of the House.java file)

Then make sure your Window.java file (class main.ee.asus.GUI.FrameWindow.Window) does have the line "include xxx.yyy.zzz.House;" in it.

VonC
A: 

I sometimes get weird behaviour with missing class files etc. when Eclipse is out of sync with the filesystem.

You could try refreshing all of your projects and doing a full rebuild.

MatthieuF