11

Is it possible to debug code line by line in Eclipse showing which line is executing so that I understand the logic of the code? I'm new to programming, please give me suitable advice.

4 Answers 4

17

It is possible if you launch your program in debug mode:

Eclipse Debug

put a breakpoint in the section you want to debug.

Here is a quick tutorial to make a Debug launch configuration:

Debug launch configuration

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

Comments

1

you need to:

  1. create a breakpoint by double clicking the left margin of the code
  2. launch your program in debug mode
  3. use the stepping buttons or F5-F8 to step in different ways

Comments

1

Sure. You can set a breakpoint, at then step line-by-line in the debugger.

This works by running your program in debug mode (the easiest way is to launch it with the Debug button as opposed to the Run button).

In the Java source code view, you can click in the line number gutter to enable breakpoints.

When execution hits that line, the Debug perspective will open, where you can inspect (and change!) all variables, and continue execution step by step.

Comments

0

Yes set a break point and step through the code.

Comments

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.