简体   繁体   English

Eclipse中未显示编译错误

[英]Compilation Error not displaying in Eclipse

I am using Mac Yosemite and Eclipse Luna. 我正在使用Mac Yosemite和Eclipse Luna。

I have successfully imported Maven projects into my workspace and the projects were running without any errors. 我已成功将Maven项目导入到我的工作区中,并且这些项目正在运行,没有任何错误。 The issue is Eclipse is not showing compilation error in editor or in project explorer. 问题是Eclipse在编辑器或项目资源管理器中未显示编译错误。

Default Builders is "Maven Project Builder". 默认构建器是“ Maven项目构建器”。

字符串a = 10; --eclipse没有显示任何错误

生成器

Right click a project in the project explorer and choose Maven > Update project , or press 在项目浏览器中的项目上单击鼠标右键,然后选择“ Maven >“ Update project ,或按
Alt + F5 . Alt + F5 Select all the relevant projects and Ok. 选择所有相关项目,然后单击确定。 This automatically cleans and updates the workspace. 这将自动清理并更新工作区。

  1. Right click on your project and go to Properties. 右键单击您的项目,然后转到“属性”。
  2. Goto Java Build Path and then select Source tab. 转到Java构建路径,然后选择“源”选项卡。
  3. In this Tab there should be an entry with yourProjectName/src . 在此选项卡中,应该有一个带有yourProjectName / src的条目。
  4. Expand this and in the Excluded-property, remove everything, ie, it should not exclude anything. 展开此内容,然后在“排除的属性”中删除所有内容,即不应排除任何内容。
  5. Remove any other entries in Source tab only yourProjectName/src should reside. 删除“源”选项卡中的所有其他条目,只有yourProjectName / src应该驻留。

After this you may see errors in your project in package explorer. 之后,您可能会在包资源管理器中看到项目中的错误。 Expand src folder and remove the package that is showing the error. 展开src文件夹,然后删除显示错误的软件包。

It helped me this way. 这样对我有帮助。

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

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