Latest web development tutorials

Eclipse Debug debugging

Debug debugging Java programs

We can view the Package Explorer to debug Java programs, follow these steps:

  • Right-click the main function contains the java class
  • Select Debug As> Java Application

This operation can also be accomplished via the shortcut keys, shortcut key combination Alt + Shift + D, J.

The above operation creates a new Debug Configuration (debug configuration) , and use that configuration to start Java applications.

If the Debug Configuration (debug configuration) has been created, you can choose Debug Configurations select the corresponding class by Run Debug menu and click the button to start the Java application.

debug_program_1

Debug menu item Run menu before it can be reloaded using the java application debug mode.

debug_program_menu

Before re-loaded using the debug mode java application shortcut F11.

When using the debug mode on java program that prompts the user to switch to the debug perspective. Debug perspective provides a breakdown of other views for troubleshooting application.

java editor can set breakpoints. Right-click the marker bar in the editor and choose Toggle Breakpoint to set the breakpoint debugging.

debug_program_2

Breakpoints can be seen in the marker bar. You can also be seen in the Breakpoints View (Breakpoints view).

When the program executes the breakpoint code JVM hang tag program, then you can view the memory usage and control program execution.

When the program hangs, Debug (debug) view can examine the call stack.

debug_program_3

variables (variables) view to display the values ​​of variables.

debug_program_4

Run menu to continue execution (Resume) menu item, skip (Step Over) line of code into the function (Step Into) and the like.

debug_program_5

The above picture shows the shortcut keys Resume, Step Into and Step Over and other associations.