I’m fairly new to java/eclipse development and I’m having a bit of a problem debugging code from a specific jar in a web app that my company uses.
First off, I have Tomcat setup properly and can run the webapp successfully (other than the bug that I’m trying to find!). There are about two dozen jar files in the lib directory for the webapp, and when I’ve tried to debug files in other jars the debugger catches their breakpoints correctly and everything is happy. Breakpoints I set in code in the new jar are skipped, and when I catch a breakpoint further along the debug stack any attempt to click to the class I’m interested in results in “Source not found”.
I click the “Edit Source Lookup Path…” button, click the project that contains the code, and it simply returns me to the “Source not found” error. I’ve tried setting up the lookup path both as a project as well as a File System Directory and a Workspace Project. Same result every time.
I’m a little fuzzy on how exactly the debugger ties a particular function call in the debug stack window to source code – is it simply based on the package and class name of the course file? If so, I can’t see why it wouldn’t be working.
Any ideas?
Make sure you are pointing at the right directory. If the class was com.foo.SomeClass then you need to set the src directory to the base directory such that Eclipse can find $basedir/com/foo/SomeClass.java. This isn’t necessarily the root of the project, it might be $project/src, or even $project/src/main/java for Maven projects.