16
votes

Double-clicking in the blue bar on the left of eclipse sets a breakpoint. Double-clicking again removes the breakpoint. This works great for me but if I use git to checkout a different branch, often times the blue dots for breakpoints get "confused" or something. I can no longer double-click to unset them. I am forced to go into debug perspective, and find the breakpoint in the "breakpoints" view and then right click and remove. Does anybody have an easier solution for this? I am coding in java on windows 7 for what it's worth.

I can reproduce this bug with this code (assume the if is line 1):

if(bool)
{
  // comment
  doSomething();
} else {
  doOther();
}

I breakpoint on line 4 - doSomething(). Then I put a new line above the if to shift everything down. (moving the breakpoint on line 5). Then I do git stash save. When I click back to eclipse, the blue dot is displayed on the correct line, but the breakpoint window still says line 5. If I double click to disable, it actually adds a second breakpoint on line 4.

I feel like I should report this to the Eclipse guys.

5
There's a 'Remove all breakpoints' option on the 'Run' menu - Bob Flannigon
What version of eclipse are you using? I've seen a bug report where older versions of eclipse create two breakpoints but only remove one. - Dave Richardson
Version: Indigo Service Release 2. Build id: 20120216-1857 Is that old? - benathon
I don't think so, but I, personally, wouldn't recommend you to upgrade to the latest Juno.. Still a bit slow and some glitches in performance. - user

5 Answers

5
votes

Right click on the break point -> Disable break point. Should work. Also, if you click (in the same menu) on the "toggle breakpoint" again, it disappears fully; In the first case it just disables it, but it remains existing.

36
votes

open debug perspective [right conrer]

go to breakpoints

click clear all breakpoints [double X] or scroll until you find the breakpoint which doesn't want to go away and delete it.

9
votes

None of the solutions here worked for me. Because I removed the breakpoints from breakpoints view but could not get rid of them in the editor. I think this is a kind of bug. What it worked for me is simply

  1. Select the whole class (Ctrl + a)

  2. Cut the whole class (Ctrl + x)

  3. Paste it back (Ctrl + v)

Sometimes, the solution is easier than we think:)

6
votes

Goto Run -> Remove All Breakpoints. This will clear all breakpoints which cannot be removed individually.

3
votes

This happens to me sometimes. In the Debug Perspective there is a breakpoints tab. Even if breakpoints have become invisible in the editor, they are probable visible in that list. So you can safely remove the breakpoints that you want to get rid off.