Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set a breakpoint in java core class in eclipse?

I am using the eclipse3.4.6 and I have attached the src.zip to eclipse. I can successfully view the source code eclipse, but the breakpoint set in java core class dosn't work; for example.

HashMap test = new HashMap();
test.put("a", 0);

I can't step into test.put("a", 0) even if I set a breakpoint in HashMap.class at the begenning of 'put' method.

Thanks in advance.

like image 299
goddyang Avatar asked Jan 04 '12 14:01

goddyang


2 Answers

Please make sure you are using JDK not JRE in build path of your project.

like image 200
Funky coder Avatar answered Oct 11 '22 04:10

Funky coder


I think you might be setting a "line breakpoint" which Eclipse isn't able to map to the right line possible because the source you are looking at is not exactly the same as that of the class that is running.

Try setting a "method breakpoint" instead. Open the HashMap class and in the Outline view, right click the put method and select Toggle Method Breakpoint.

like image 30
dogbane Avatar answered Oct 11 '22 05:10

dogbane