Java 所需项目中存在 Eclipse 错误,但编辑器未显示错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19629099/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 18:56:50  来源:igfitidea点击:

eclipse errors exist in required projects but editor shows no errors

javaeclipse

提问by Akash

I use eclipse to code in java. My code was running perfectly fine. Finally, i deleted some files which were not needed from my drive.

我使用eclipse在java中编码。我的代码运行得很好。最后,我从我的驱动器中删除了一些不需要的文件。

Right now, I have the source file and the compiled .class files in the correct folders. Also, although I initially had multiple .java files, I am 100% sure that the one I need is there and also that it doesn't need anything from any other thing. All the imports (i import only from standard libraries) are showing no error.

现在,我在正确的文件夹中有源文件和编译的 .class 文件。此外,虽然我最初有多个 .java 文件,但我 100% 确定我需要的文件在那里,而且它不需要任何其他东西。所有导入(我只从标准库导入)都没有显示错误。

The problem is that when i make any changes in my .java file, and save it, it does get saved but when I execute the code, it runs just like the old version, i.e. the changes are not reflected in the output.Also, on clicking 'run', eclipse gives a warning that 'errors exist in required projects' although the editor shows none.

问题是当我在我的 .java 文件中进行任何更改并保存它时,它确实被保存了但是当我执行代码时,它就像旧版本一样运行,即更改没有反映在输出中。此外,在单击“运行”时,eclipse 会发出警告,指出“所需项目中存在错误”,尽管编辑器未显示任何错误。

Whats going wrong ? Please help.

怎么了?请帮忙。

回答by Akash

Okay got it....I had added some external jars to my project. Later, when I realised that they were not needed anymore, i deleted them from my hard disk. However, the build path contained their names too among the other libraries (and displayed "missing" after that). I removed them and its working fine.

好的,明白了......我在我的项目中添加了一些外部罐子。后来,当我意识到不再需要它们时,我从硬盘中删除了它们。但是,构建路径在其他库中也包含它们的名称(之后显示“丢失”)。我删除了它们并且它工作正常。