Launching a program in debug mode allows you to suspend and resume the program, inspect variables, and evaluate expressions using the debugger.
To launch a Java program in debug mode,
If you want your program to stop in the main method so that you can step through its complete execution, create a Java Application launch configuration and check the Stop in main checkbox on the Main page.
You can also debug a Java program by selecting a project instead of the compilation unit or class file. You will be prompted to select a class from those classes that define a main method. (If only one class with a main method is found in the project, that class is launched as if you selected it.)
You can debug a program from an open editor by using Run > Debug As > Java Application in the editor's popup menu.
Java views
Java editor
Debugger
Connecting to a remote VM with the Java Remote Application launcher
Relaunching a program
Running and debugging
Setting execution arguments
Stepping through the execution of a program