Source not found during debugging

I am 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 performs, but gives the wrong result. NamesTester is a test class of the Name class.

During debugging, when I use the step in the insert method, it goes into a strange document called ArrayList<E>.size() , and it shows that Source was not found. I do not know what happened. Does this mean that I cannot enter the method to see what happens there? But if I use step by step, it debugs the following steps in order.

Can someone help me find a reason and solution? Thanks!

+4
source share
5 answers

This means that you have switched to the definition of a class to which the path to the project class does not have access. For example, the Java JVM source code. In your case, maybe he tried to go into the definition of ArrayList.

Look through google about debugging in eclipse, log in and go through

+1
source

You are debugging Java code at runtime, but you do not have its sources installed on your computer. The easiest way to avoid this in the future is to install the full Java Development Kit (JDK), not just the Java Runtime Environment (JRE), and make sure that Eclipse uses this JDK.

0
source

The method pointing to ArrayList.size () is a method of the ArrayList class for jdk.

First: the source was not found, this is not an error. The source was not found when you are in debug mode, and when debugging, you enter some class whose .java file is not in the class path. This message simply means that the part of the code you are trying to undo is not available for this, and therefore the debugger cannot display the highlighted line, etc. Now, to fix this, I mean the ability to see this method in your debugger, download the source code for jdk (the same version you are currently using), and when you see a screen not found by the source, there is an atrach source button . select this and select the source code file that you downloaded and click ok. and the tge screen refreshes with the highlighted class line.

0
source
  1. click Attach source
  2. Check External locations and click External files
  3. add src.zip from Program Files / java / jdk1.x / src.zip
0
source

I think you need to attach the source code to the library, this will help the debugger find it.

follow this thread in section 16.2,

Hope this helps you.

-1
source

Source: https://habr.com/ru/post/1437909/


All Articles