While debugging a java app in eclipse I receive a "Source not found" error in two cases:
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!
Eclipse debugging works with the class actually loaded by the program.
The symptoms you describe sounds like the class in question was not found in the project, but in a distribution jar without debug info found before the project you are working with.
This can happen for several reasons but have a look at the location where the classes showing this behaviour is found (look in the navigation pane to identify it). You will most likely need to change the build path of the project to avoid using this jar and have the JVM use the project instead.
EDIT: Note that as of 2018 it is common to use a build framework like Maven, where the build path is managed by the m2e plugin so this problem should be very less frequent than when the question was asked. If you use Maven and m2e, make sure to enable Preferences / Maven / "Download Artifact Sources" or right-click the project, Maven / "Download Sources".
hi thanks for all but i found this answer more usefull (stack over flow link)[stackoverflow.com/questions/5815013/…
@shareef that link is about missing javadoc, not missing source.
@ACV Well, yes. Perhaps it is not as elaborate as you would like - could you let me know what you would like to have explained better?
the answer is another way of saying: the problem is "source not found", and my suggestion is "try to find the source"
@dhein Consider opening a new question with a lot more detail.