Eclipse java debugging source not found

861    Asked by Bhaanumatishukla in Salesforce , Asked on Jul 16, 2021

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 repositoryI 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 eclipsejava so an explanation of why this is happening + how to resolve this would help a lot!

Answered by Buffy Heaton

 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. Source not found 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



Your Answer

Interviews

Parent Categories