简体   繁体   English

导入现有项目后,Eclipse认为“ src”是软件包名称的一部分

[英]Eclipse considers “src” to be a part of the package name after importing existing project

I have imported an Eclipse (Mars) project on another Computer with the latest version of Eclipse. 我已经在另一台装有最新版本Eclipse的计算机上导入了一个Eclipse(火星)项目。 Now Eclipse considers the /src/ folder as a part of the package name. 现在,Eclipse将/src/文件夹视为软件包名称的一部分。 Eg src.org.domain.subdomain instead of org.domain.subdomain . 例如src.org.domain.subdomain而不是org.domain.subdomain

项目视图中的软件包名称

I can rename the package, removing src but then Eclipse will actually move the folder to the root folder, but I want the source to stay in src . 我可以重命名该软件包,删除src但是Eclipse实际上会将文件夹移动到根文件夹,但是我希望源代码保留在src

Is there a way to fix this? 有没有办法解决这个问题? How does Eclipse determine what the root folder of the source is, is it possible to set this manually? Eclipse如何确定源的根文件夹是什么,是否可以手动设置? Has this behavior changed from Mars to the latest version? 此行为是否已从火星更改为最新版本?

Thanks to daniu 's comment I could resolve my issue, I'll quote it: 感谢daniu的评论,我可以解决我的问题,在此引用一下:

Select Project->Properties->Build Path, remove the existing source folders, select the folder "src". 选择“项目”->“属性”->“构建路径”,删除现有的源文件夹,然后选择文件夹“ src”。

Thanks! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM