Reputation: 2355
I'm using the Eclipse IDE for Java EE Developers (Mac OS X 64 Bit) to debug my two java documents. I have a Name
class with a method named insert
. It executes but gives wrong result. NamesTester
is test class for Name
class.
During debug, when I using step into the insert
method, it jumps to a strange document named ArrayList<E>.size()
, and it shows Source not found. I don't know what's wrong. Does it means I can not step into a method to see what is happening there? But if I use step over, it's debugging next steps fine.
Can someone help me in finding the reason and solution? Thank you!
Upvotes: 4
Views: 2875
Reputation: 567
Attach source
External locations
and click External files
src.zip
from Program Files/java/jdk1.x/src.zipUpvotes: 1
Reputation: 473
I think you need to attach source code to the library, this will help the debugger to find it.
follow this thread section 16.2,
hope this will help you.
Upvotes: -1
Reputation: 8467
The method you pointing to ArrayList.size() , is a method of ArrayList class of jdk.
First : source not found is not an error. source not found comes when you are in debug mode and while debug you enter some class whose .java file is not located on classpath. This message just means that , the part of code you are trying to debu, source cide for that is not available and thus the debugger cant show the highlighted line etc. Now to correct this, i mean be able to see that method in your debugger, download the source code for jdk(the same version that you are using currently) and when you see the source not found screen , there is a atrach source button.select that and select the source code file you have downloaded and press ok. and tge screen will refresh with the highlighted line of the class.
Upvotes: 0
Reputation: 22070
You debugged into the Java runtime code, but you don't have its sources installed on your machine. The most simple way to avoid that in the future is to install a full Java development kit (JDK) instead of only a Java runtime environment (JRE) and to make sure that Eclipse uses that JDK.
Upvotes: 0
Reputation: 7569
It means you jumped into a class definition your project classpath has no access to. For example Java JVM source code. In your case, perhaps it tried to jump into ArrayList definition.
Look out thru google about debugging in eclipse, step into and step thru
Upvotes: 1