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!
A Java program can be debugged simply by right clicking on the Java editor class file from Package explorer. Select Debug As → Java Application or use the shortcut Alt + Shift + D, J instead. Either actions mentioned above creates a new Debug Launch Configuration and uses it to start the Java application.
With the test class open in the Eclipse editor, simply right click in the editor view and select Debug As > TestNG Test. Eclipse will stop at any breakpoints you set just like it would with any other local debug process.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With