eclipse mistakenly interprets packages as “resourc

2019-06-25 06:46发布

I'm importing an existing source tree as an Eclipse Java project. When I do, I get errors in classes (such as mycompany.logging.LogEntry) along the following lines:

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

The problem seems to be that Eclipse does not realize that the directory src/mycompany/logging is a package directory --- instead it thinks it's a source folder in its own right, analogous to src/, and that LogEntry is part of the default package in that folder.

Can anyone advise? Thanks very much.

1条回答
爷、活的狠高调
2楼-- · 2019-06-25 07:23

Do you have, in your imported project, configured the source path to be src?

Java Build Path

Then you should see packages like:

mycompany.logging

See also Configuring an Eclipse Java Project

查看更多
登录 后发表回答