Java Debugging With Visual Studio Code
Java Debugging With Visual Studio Code
Debugging allows you to run a program interactively while watching the source
code and the variables during the execution.
A breakpoint in the source code specifies where the execution of the program
should stop during debugging. Once the program is stopped you can investigate
variables, change their content, etc.
Here are some quick tips and tools that will help you get started quickly with
debugging your Java project.
2. Run a program in debug mode
• Right click on the class contain method main() -> Debug Java.
3. Breakpoints
4. Stepping commands
The Eclipse Platform helps developers debug by providing buttons in the toolbar
and key binding shortcuts to control program execution.
• Continue (F5): executes the current statement and jumps to next breakpoint
or to the end of program.
• Step Over (F10): Step over the call.
• Step Into (F11): Step into the call.
• Step Out (Shift + F11): executes the current statement and returns to the
place called this method.
• Restart (Ctrl + Shift + F5): restart debugging.
• Stop (Shift + F5): terminate debugging.
If a Breakpoint is encountered, the program will stop for you to control and
monitor. As you can see, the program will stop at Breakpoint at line number 9:
--------oooooENDooooo--------