Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Eclipse Java Development User Guide
Previous Page Home Next Page

Launching a Java program in debug mode

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,

  1. In the Package Explorer, select the Java compilation unit or class file with the main method you want to launch.
  2. Press the Debug [ ] button in the workbench toolbar or select Run > Debug from the workbench menu bar. Alternatively you can select Run > Debug As > Java Application from the workbench menu bar, or select Debug As > Java Application in the Package Explorer pop-up menu or in the drop-down menu on the Debug tool bar button.
  3. Your program is now launched and the launched process appears in the Debug view. 

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 tab. 

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.)

Related concepts
Java views
Java editor

Related tasks
Connecting to a remote VM with the Java Remote Application launcher
Re-launching a program
Running and debugging
Setting execution arguments
Stepping through the execution of a program

Related reference
Debug view
Package Explorer

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire