0

I have simple java programme like below :

import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @author 
 *
 */
public class IteratorRemoveTest {

/**
 * @param args
 */
public static void main(String[] args) {
    // TODO Auto-generated method stub

    List<String> l = new CopyOnWriteArrayList<>();

    l.add("a");//Line 11

}

}

I have set breakpoint at line 11 and want to debug into the add method by pressing the F5 or step into button available in the eclipse.

Below is the information about setup :

  1. I have source code attached to the eclipse and able to view the source code of the class.
  2. When I set the debug point inside the add method I get the error : Image showing the error message

  3. I have gone through the similar question How can I step into a core java class method in Eclipse? and tried all the ways but could not get the debug into the class file code.

  4. Installed JRE snapshot : Installed JRE

  5. Debug configuration : Debug configuration

Please let me know if any additional information is needed.

Guys, any sort of help/guidance is much appreciated.

3
  • IntelliJ does this seamlessly, no additional information required. Use a better IDE. Commented Feb 15, 2018 at 16:19
  • @duffymo Even eclipse does this properly but there is something missing in the configuration that I need to find out and correct that. And FYI Eclipse is also widely used. Commented Feb 15, 2018 at 16:24
  • I know, I used to use Eclipse exclusively. Until I was shown IntelliJ. It's a far superior product. Commented Feb 15, 2018 at 18:18

2 Answers 2

1

I try myself and it work for me. One difference is that I am using a java jdk no jre. Possibly jre do not include the source code.

Sign up to request clarification or add additional context in comments.

1 Comment

Indeed in the JDK the classes are compiled with line numbers annotated in the code, and in the JRE the compilation does not add them. So use the JDK for development.
0

Check that the line numbers are turned on in the compiler Classfile configuration Select Window > Preferences and then type 'comp' in the filter. Select Java > Complier and check the highlighted checkbox

:

Classfile configuration

1 Comment

It's already check marked but still debugger not going into class file codes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.