eclipse错误地将软件包解释为“资源"或源文件夹 [英] eclipse mistakenly interprets packages as "resources", or source folders

查看:77
本文介绍了eclipse错误地将软件包解释为“资源"或源文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将现有的源树导入为Eclipse Java项目.当我这样做时,会在以下几行中出现类(例如mycompany.logging.LogEntry)中的错误:

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 ""

问题似乎是Eclipse没有意识到src/mycompany/logging目录是一个软件包目录---相反,它认为它本身就是一个源文件夹,类似于src/,而LogEntry是其中的一部分该文件夹中的默认软件包.

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.

推荐答案

在导入的项目中,您是否已将源路径配置为src?

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

然后您应该看到类似以下的程序包:

Then you should see packages like:

mycompany.logging

另请参见配置Eclipse Java项目

这篇关于eclipse错误地将软件包解释为“资源"或源文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆