简体   繁体   English

Eclipse:文件中甚至项目中都不存在错误

[英]Eclipse: Errors in files not even in the project

Eclipse randomly won't let me compile my project because of errors in java files that aren't even in the project. Eclipse随机不允许我编译我的项目,因为Java文件中的错误甚至不在项目中。 They're part of another project I made over a week ago. 它们是我一周前完成的另一个项目的一部分。

Here are the screenshots of the expanded hierarchy to show I'm not blind: 以下是展开的层次结构的屏幕截图,以显示我不是盲目的:

等级制度等级制度等级制度

Here's a screenshot after going to Window > Show View > Problems: 这是转到窗口>显示视图>问题后的屏幕截图:

在此处输入图片说明

I tried commenting out all the code in the DB class leaving only public class DB { } uncommented as a temporary solution, and it still throws an error saying The declared package "" does not match the expected package RemoteSystemsTempFiles.urlToMyDirectoryOnARemoteServer . 我尝试注释掉DB类中的所有代码,仅保留未注释的public class DB { }作为临时解决方案,它仍然引发错误,指出The declared package "" does not match the expected package RemoteSystemsTempFiles.urlToMyDirectoryOnARemoteServer So I'm guessing something is up with the temp files. 所以我猜测临时文件有问题。

The path in your problems window seems to show the files are in MyProject/src/re...<something> . 问题窗口中的路径似乎表明文件位于MyProject/src/re...<something>

It looks like you have a filter on in the first view that is hiding files that are actually in the project build path and have these errors (in particular DB.java and Config.java )? 它看起来像你在被隐藏,实际上是在项目构建路径,并让这些错误(尤其是文件中的第一个视图有一个过滤器上DB.javaConfig.java )?

To check this 要检查这个

In the navigator window - little down arrow on the top right of (sub)window, tool tip is View menu , one of items on menu is Filters... . 在导航器窗口中-(子)窗口右上角的小向下箭头,工具提示是“ View menuView menu一项是“ Filters... You see a list of filters being applied to files for display - check for names or types being hidden. 您会看到一个应用于文件进行显示的过滤器列表-检查名称或类型是否被隐藏。

EDIT 编辑

Following OP comments - unchecking filter on Remote Systems File Cache revealed the files and the compilation error was solved by deleting the remote temp directory associated with the previous project OP后面的评论-取消选中“ Remote Systems File Cache上的筛选器会显示文件,并且通过删除与先前项目相关联的远程临时目录来解决了编译错误

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

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