While debugging a java app in eclipse I receive a \"Source not found\" error in two cases:
Just 3 steps to configuration Eclipse IDE:
Note: After updating the Source Lookup paths, you'll have to stop and restart your debug session. Otherwise, the file with the missing source will continue to show "missing source".
Edit Source Lookup Select the Edit Source Lookup... command [ Edit Source Lookup ] to open the Source Path Dialog, which allows you to make changes to the source lookup path of the selected debug target.
IMPORTANT Restart Eclipse after this last step.
I was facing the same issue,I followed the bellow steps.
Window => Preferences => Java => Installed JREs,
You see in the above screen Jre1.8.0_12
is selected.
select the JRE you are using and click Edit. Now You should see the bellow screen.
Click on the directory, browse for Jdk, It should look like bellow screen.
click ok, and its done
When running in debug mode, click Edit Source Lookup after suspended from thread. At this point, we should be able to add the necessary project/jar which contains your source code. After I added my current project in this way, and it solved my problem. Thanks
In my case in "Attach Source", I added the other maven project directory in the "Source Attachment Configuration" panel. Adding the latest version jar from the m2 repository din't work. All the classes from the other maven project failed to open.
Here test was my other maven project containing all the java sources.
In my case the Maven version of the other referenced project didn't match the version of the test project. Once they were the same, the problem disappeared.
Evidently, Eclipse does not automatically know where the source code for the dependent jars are. It is not clear why debugger could not inspect variables once the source was attached. One possibility is incorrect/incompatible source.
Assuming you have a maven project and the sources of the dependencies are downloaded and available in the local repository, you may want to install m2eclipse, the maven eclipse plugin and see if that helps in addressing your issue.