Eclipse mistakenly interprets packages as "resources" or source folders

I am importing an existing source tree as an Eclipse Java project. When I do this, I get errors in classes (e.g. mycompany.logging.LogEntry) in the following lines:

  The package mycompany.logging does not match the expected package "" 

The problem is that Eclipse does not understand that the src / mycompany / logging directory is a package directory - instead, it considers it to be the source folder of its choice, similar to src /, and that LogEntry is part of the default package in this folder.

Can anyone advise? Thank you very much.

+4
source share
1 answer

Is the source path configured as src in your imported project?

Java build path

Then you should see packages like:

mycompany.logging 

See also Configuring an Eclipse Java Project

+5
source

All Articles