Yes, Eclipse is baffling sometimes. Here's something to try. Right-click on your project, then click on Properties. In the Properties dialog, click on Java Build Path. In the Source tab, you should see the folder where your Java code is. If not, then add it. That may be the problem, but just in case, I'm going to move this thread to our IDE forum, where the real experts can take a crack at it.
When running in debug mode, right click on the running thread (in threads tab) and select Edit Source Lookup. At this point, you should be able to add the necessary project/jar which contains your source code.
Thanks for the suggestions. I have looked at the Build Path and it seems to have the source code path linked. I say "seems" because this is an open source project I am trying to debug and the Project structure is quite complicated. If I try explicitly add the directory with the source code it causes all sorts of other errors, probably caused by conflicting sources?
The project is the QuickFIXJ project, the Banzai example.
The other issue I am finding is that it when I press F5 it also tries to move into the actual Java SDK source. I would not expect this as I am sure people don't want to step through the entire Java source code while debugging their programs! So I probably have some setting that I am missing as I only want to debug the code relevant to the project.
Notice that the issue is occurring with the "new" functionality ("SessionSettings settings = new SessionSettings(inputStream);"). I would have thought that this would move to the source code containing the class definition, namely SessionSettings.java, but perhaps it is moving into the internal Java code for class instantiation, and then saying source not found?
Well the last line of code before pressing F5 was my own, but from there it was stepping into the JDK without me realizing it. Never even crossed my mind really because it is not something that would happen with C++ or C# debuggers
F5 means Step Into. If you want don't want to Step Into, use F6, Step Over. I'm extremely skeptical of your implied claim that you can't step into C-sharp API classes. Hang on, we've got an emoticon for that ... ah, here it is:
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop