原因尚且未知,网上找到的几种解决方法如下:
1.Debug 视图下
-》在调试的线程上 右键单击
-》选择Edit Source Lookup Path
-》选择Add
-》选择Java Project
选择相应的Project 进行OK确定即可
——添加完相应的项目之后,还是出现这个错误 ?
2.
Window --> Preferences --> Tomcat --> Source Path,在Source Path 标签下有行文字:Add java projects to source path(Eclipse debugger will search for source files in these projects),将要调试的project选中,
3.
tomcat server.xml debug=0 如果设置的是1 就会显示source not found——server.xml里面没有看到debug=0或1 ?
但自己试了上面几个方法之后,都不行。后来乱点一通解决了。方法:
Window --> Preferences --> Java --> Compiler
把Compiler compliance level的值,设为1.6 就行了。
原因是原来我的jdk版本是1.7,上面编译的level就是1.7。后来我改装回1.6的jdk,eclipse没有自动改回来,所以出现这个问题。