eclipse/subclipse 项目未显示红线错误
我正在为学校做一个小组项目。我从存储库中检查了该项目。当我编写代码时,语法错误的红线不会显示。所以我在我的机器上创建了一个单独的java项目,并且红线错误确实出现在那里。所以我不知道发生了什么事。
I'm working on a group project for school. I checked the project out from the repository. When I write code, the red lines for syntax errors don't show up. So I made a separate java project on my machine and red line errors do show up there. So I don't know whats going on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
Eclipse 突然停止在代码和问题视图中显示编译错误。
我创建了一个动态 Web 项目,添加了一个 servlet,一切都很顺利;编译错误正确显示。
我右键单击 MyProject->Configure->ConvertToMavenProject 并开始出现问题。在我的BuildPath中,JRE版本从1.6更改为1.5;这导致了一些以前未报告的编译问题,当我改回 1.6 后,这些问题就消失了。
但现在,代码中没有出现编译错误。
原因是,转换为 Maven 项目也从构建路径中删除了我的 src 文件夹。我将 src 文件夹添加回构建路径,一切顺利。
Eclipse suddenly stopped showing compile errors, both in the code and in the Problems view.
I had created a Dynamic Web Project, added a servlet and everything was groovy; compilation errors showed up properly.
I did right click on MyProject->Configure->ConvertToMavenProject and problems started. In my BuildPath, the JRE version was changed from 1.6 to 1.5; this caused some previously unreported compilation problems that went away as soon as I change back to 1.6.
But now, no compilation errors showed up in the code.
The reason was, converting to a maven project also removed my src folder from the build path. I added the src folder back to the build path and things are peachy.
右键单击您的项目并转到“属性”> Java 构建路径 >来源。
确保您的源目录(例如MyProject/src)被列为源文件夹。否则你不会得到任何红色标记。
Right-click your project and go to Properties > Java Build Path > Source.
Make sure your source directory (for example MyProject/src) is listed as a Source folder. Otherwise you won't get any red markers.
波浪线是可配置的;在首选项中查看常规 ->外观->编辑->文本编辑器 ->注释和“错误”注释类型。
Squiggles are configurable; in Preferences see General -> Appearance -> Editors -> Text Editors -> Annotations and the "Errors" annotation type.
确保您的 .project 文件看起来像这样:
如果它不像上面那样,那么您将无法进行语法检查,也无法获得 Java 项目附带的许多其他功能。
Make sure your .project file looks something like this:
If it doesn't look like the above, then you aren't going to get syntax checking, as well as a number of other features that come along with Java projects.
我也有这个问题。一个项目之后-->干净了,我又恢复正常了。
编辑...再次发生 - 意识到我不小心取消选中了“项目 --> 自动构建”菜单选项。现在按预期工作。
I had this problem as well. After a project --> clean, I'm back to normal.
Edit ... Happened again - realized that I had accidentally unchecked the "Project --> build-automatically" menu option. Now working as expected.
去检查是否在你的Java Build Path ->图书馆有一个丢失的罐子。
当我删除我的案例中丢失的罐子时,自动错误再次显示。
Go to check whether in your Java Build Path -> Libraries has a missing jar.
When I remove that missing jar in my case, the auto-error shows again.