While debugging a java app in eclipse I receive a "Source not found" error in two cases:
- Stepping in to a file in a different project which is already imported
- Stepping in to a file in an installed maven repository
The files are there, but eclipse won't step into them, instead it shows a button to "attach source"
I tried attaching (which opened a dialog to define a variable?!) and eclipse did jump to the file, but the debugger could not inspect any variables there. Also manually attaching the source for each dependency isn't practical, as in my case there are thousands of dependency files.
I'm new to eclipse\java so an explanation of why this is happening + how to resolve this would help a lot!
I had similar problem with my eclipse maven project. I fought with this issue quite a long time then I tried to rebuild projet with
and it helped.
If you want to attach source code to any JAR by auto-downloading, try using this Eclipse plugin Java Source Attacher
In my case problem was resolved by clicking
Remove All Breakpoints
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.
I had this problem while working on java code to do process on a excel file containing a data set, then convert it to .csv file, i tried answers to this post, but they did not work. the problem was the jar files themselves. after downloading needed jar files one by one(older releases) and add them to my project, "source not found" error vanished. maybe you can check your jar files. hope this would help.