This question already has an answer here:
这个问题在这里已有答案:
- Eclipse error: “The import XXX cannot be resolved” 22 answers
- Eclipse错误:“导入XXX无法解析”22个答案
Though I have all my source in proper packages.It couldn't find at the time of Building Project.Normally it shows links everything.But at the time of Build Project or Autobuild while directly running project.
虽然我把所有的资源都放在正确的包中。但是在构建项目的时候找不到它。通常它显示链接的一切。但是在Build Project或Autobuild时直接运行项目。
The import ecnet.rd.config cannot be resolved
like it shows for all the internal imports.But external imports like imports from JAR files are working.
就像它显示所有内部imports.But外部导入,如从JAR文件导入正在工作。
P.S :
P.S:
My Eclipse latestly crashed but it was working well after that, Once again this kind of things are happening.
我的Eclipse最近崩溃了,但之后运作良好,再一次发生了这种事情。
Please help to find the way to solve this.
请帮忙找到解决这个问题的方法。
3 个解决方案
#1
31
In my experience, it is usual with Eclipse to have the build messed up. Make sure Build automatically
is checked and Clean
. If it doesn't work, restart Eclipse and do again.
根据我的经验,Eclipse通常会让构建搞砸了。确保自动检查Build并清理。如果它不起作用,请重新启动Eclipse并再次执行。
Also as Tech Junkie comments below, try also Clean all projects
.
另外,正如Tech Junkie在下面评论,也请尝试清理所有项目。
#2
7
I've seen this happen and another approach to take which is similar to m0skit0 solution (if you are using Eclipse) is to right click
on the project, select maven
, select update project
, make sure clean projects
and refresh workspace
are checked, and hit ok
.
我已经看到这种情况发生了,另一种类似于m0skit0解决方案的方法(如果你使用的是Eclipse)是右键单击项目,选择maven,选择更新项目,确保清理项目和刷新工作区,并且好的。
#3
4
After hours of struggle, creating a new Eclipse workspace, reimporting the projects and resetting up the same tomcat instance worked.
经过数小时的努力,创建一个新的Eclipse工作区,重新导入项目并重置同一个tomcat实例。
Probably the eclipse settings got messed up, and the deploy wasn't being done correctly anymore.
可能是日食设置搞砸了,部署还没有正确完成。
#1
31
In my experience, it is usual with Eclipse to have the build messed up. Make sure Build automatically
is checked and Clean
. If it doesn't work, restart Eclipse and do again.
根据我的经验,Eclipse通常会让构建搞砸了。确保自动检查Build并清理。如果它不起作用,请重新启动Eclipse并再次执行。
Also as Tech Junkie comments below, try also Clean all projects
.
另外,正如Tech Junkie在下面评论,也请尝试清理所有项目。
#2
7
I've seen this happen and another approach to take which is similar to m0skit0 solution (if you are using Eclipse) is to right click
on the project, select maven
, select update project
, make sure clean projects
and refresh workspace
are checked, and hit ok
.
我已经看到这种情况发生了,另一种类似于m0skit0解决方案的方法(如果你使用的是Eclipse)是右键单击项目,选择maven,选择更新项目,确保清理项目和刷新工作区,并且好的。
#3
4
After hours of struggle, creating a new Eclipse workspace, reimporting the projects and resetting up the same tomcat instance worked.
经过数小时的努力,创建一个新的Eclipse工作区,重新导入项目并重置同一个tomcat实例。
Probably the eclipse settings got messed up, and the deploy wasn't being done correctly anymore.
可能是日食设置搞砸了,部署还没有正确完成。