tags:

views:

72

answers:

2

Hello,

I've just created a project on Eclipse and imported some source files (existing project). But I can't compile it ! Ok, the project has got several source files, so I wanted to compile only the Main.java file (with eclipse not in the command line, in the command line it worked!) but all what I get is this error :

http://www.screencast.com/users/Amokrane/folders/Jing/media/82d772dd-10cd-4552-b1d0-3cf18bf39f13

As you can see the Main.java file is straighforward, just a hello world !

What's the matter ?

Thanks

+5  A: 

"Unresolved compilation problem" means that the class hasn't compiled successfully. Eclipse will still let you run code that doesn't compile, but any of the specific bits which don't compile will throw this error. Look in the "Problems" tab to see what's wrong.

From the look of the Package Explorer view, every single class has a problem... perhaps the file location doesn't match the package declaration? That would match the position of the pink box just to the right of the vertical scrollbar for the class - it suggests that the error is right at the top of the file, which is where the package declaration would be.

Jon Skeet
So yeah the error is : "The declared package does not match the expected package". I'm googling it (first time I use java, so I'm not really familiar with this notion of package..)
Amokrane
Ok it's working ! I added "package isibox;"At the begining of the Main.java file !thx :)
Amokrane
You can use Ctrl-period to move to the location of the next error in the file, and then use Ctrl-1 to see what Eclipse suggests can be done at that location.
Thorbjørn Ravn Andersen
+1  A: 

You have a compilation error at the top of your Main.java file, just out of sight in the screenshot. Probably an unresolvable import or a wrong/missing package declaration.

Michael Borgwardt
Yes it is ! What should I do ?
Amokrane