简体   繁体   English

Eclipse即使在软件包中也看不到文件

[英]Eclipse doesn't see file even it was in the package

I have worked on a project in Java Spring and using Eclipse, I met this weird thing 2 days ago, everything run ok and it suddenly corrupted. 我在Java Spring中使用Eclipse开发了一个项目,两天前我遇到了这个奇怪的事情,一切运行正常,并且突然损坏了。

In Project Explorer the "java" and "resources" folders exist, but in Package Explorer, they don't show. 在Project Explorer中,存在“ java”和“ resources”文件夹,但是在Package Explorer中,它们不显示。 Eclipse knew that "java" and "resources" as package, but it didn't see the file below, and it caused a thousand of errors because of this. Eclipse知道“ java”和“ resources”是软件包,但是它没有看到下面的文件,因此导致了上千个错误。 Almost of errors were "Some class cannot be resolved". 几乎所有的错误都是“某些类无法解决”。 See the images below: 参见下面的图片:

项目浏览器

包浏览器

I have tried many ways: clean, rebuild, re-import, restart eclipse, switch workspace, re-checkout the project in another place, download another eclipse but it is still the same. 我尝试了很多方法:清理,重建,重新导入,重新启动eclipse,切换工作区,在另一个地方重新签出项目,下载另一个eclipse,但还是一样。 Does anyone know how to solve this thing? 有谁知道如何解决这个问题?

But this is completly normal. 但这完全是正常的。 You got those dirs included as "sources" and "resources" in Package Explorer - both are threated as "sources" so they are included in Eclipse's build path. 您将那些目录作为“资源”和“资源”包含在Package Explorer中-都被威胁为“源”,因此它们都包含在Eclipse的构建路径中。 This is completly normal - in Package Explorer dirs already included as sources are ommited from file tree. 这完全是正常的-在Package Explorer中,由于源已从文件树中省略,因此已经包含了目录。 Your problem must be something else. 您的问题一定是其他问题。 Project clean should help indeed. 项目清理确实应该有所帮助。 Try to maven clean as well. 尝试清洁。

根本不缺少“缺少”的目录

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

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