38

I am using the Eclipse IDE. I don't know how effectively put breakpoints in Eclipse and go forward and backward into it. Can anyone help me?

Can anyone suggest a site suitable for me?

0xCursor
  • 2,242
  • 4
  • 15
  • 33
Jisson
  • 3,566
  • 8
  • 38
  • 71

5 Answers5

53

To put breakpoints in your code, double click in the left margin on the line you want execution to stop on. You may alternatively put your cursor in this line and then press Shift+Ctrl+B.

To control execution use the Step Into, Step Over and Step Return buttons. They have the shortcuts F5, F6 and F7 respectively.

To allow execution to continue normally or until it hits the next breakpoint, hit the Resume button or F8.

TuringTux
  • 559
  • 1
  • 12
  • 26
James
  • 2,306
  • 1
  • 22
  • 23
  • 1
    Can't believe there is no default keyboard shortcut for putting a breakpoint on the current line. Or did u not mention it? – dotNET Jun 02 '16 at 07:32
  • 1
    @dotNet Yes there is one: Shift+Ctrl+B (I added it to the answer) – TuringTux Aug 31 '16 at 13:40
  • At first, when double click in the left margin or Ctrl+Shift+B did not work to add a break-point, we restarted the Eclipse and then everything worked well. – Dhananjay M May 16 '17 at 06:53
  • 1
    a politically correct answer is not as popular as a helpful one by the looks of it. – Sajuuk Dec 24 '18 at 11:23
7

Here is a video about Debugging with eclipse.

For more details read this page.

Instead of Debugging as Java program, use Debug as Android Application

May help new comers.

peterh
  • 11,875
  • 18
  • 85
  • 108
S.Thiongane
  • 6,883
  • 3
  • 37
  • 52
1

Put breakpoints - double click on the margin. Run > Debug > Yes (if dialog appears), then use commands from Run menu or shortcuts - F5, F6, F7, F8.

Daniel Kmak
  • 18,164
  • 7
  • 66
  • 89
-1

Breakpoints are just used to check the execution of your code, wherever you will put breakpoints the execution will stop there, so you can just check that your project execution is going forward or not. To get more details follow link:-

http://javapapers.com/core-java/top-10-java-debugging-tips-with-eclipse/

Vishal Jain
  • 175
  • 2
  • 18
-1

Googling gives many sites... Debugging with the Eclipse platform for one.

Raghuram
  • 51,854
  • 11
  • 110
  • 122