the resource is not on the build path of a java project错误



the resource is not on the build path of a java project错误

在eclipse中,使用mavenimport了一个工程,但是在对某一个类进行F3/F4/ctrl+alt+H操作的时候报错:“the resource is not on the build path of a java project”。

这种情况也常常发生在重新打开eclipse时。

原因:在该工程的构建路径中找不到该类。

解决方法:

 1. 找到buildpath下面的src下的文件remove掉,然后重新加上去,此时会更新所有目录。

  2. 关闭该类,重新打开即可

3.或者删除Libraries下的没有用的package

the resource is not on the build path of a java project错误