- Eclipse - Web Browsers
- Eclipse - Tips & Tricks
- Eclipse - Restart Option
- Eclipse - Shortcuts
- Eclipse - Code Templates
- Eclipse - Install Plugins
- Eclipse - Task Management
- Eclipse - Add Bookmarks
- Eclipse - Refactoring
- Eclipse - Navigation
- Eclipse - Search Menu
- Eclipse - Hover Help
- Eclipse - Quick Fix
- Eclipse - Content Assist
- Eclipse - Preferences
- Eclipse - Debugging Program
- Eclipse - Debug Configuration
- Eclipse - Build Project
- Eclipse - Reopen Project
- Eclipse - Close Project
- Eclipse - Create Jar Files
- Eclipse - Running Program
- Eclipse - Run Configuration
- Eclipse - Java Build Path
- Eclipse - Create XML File
- Eclipse - Create Java Interface
- Eclipse - Create Java Class
- Eclipse - Create Java Package
- Eclipse - Create Java Project
- Eclipse - Workspaces
- Eclipse - Perspectives
- Eclipse - Explore Views
- Eclipse - Explore Menus
- Eclipse - Explore Windows
- Eclipse - Installation
- Eclipse - Overview
- Eclipse - Home
Eclipse Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Ecppse - Debugging Program
Debugging a Java Program
The quickest way to debug a Java program is to using the Package Explorer view. In the Package Explorer view −
Right cpck on the java class that contains the main method.
Select Debug As → Java Apppcation.
The same action can be performed using the Package Explorer by selecting the class that contains the main method and cpcking Alt + Shift + D, J.
Either actions mentioned above create a new
and use it to start the Java apppcation.If a Debug configuration has already been created you can use it to start the Java apppcation by selecting Debug Configurations from the Run menu, cpcking on the name of the debug configuration and then cpcking on the Debug button.
The Debug menu item on the Run menu can be used to restart the java apppcation that was previously started in the debug mode.
The shortcut key to launch the previously launched Java apppcation in the debug mode is F11. When a java program is started in the debug mode, users are prompted to switch to the debug perspective. The debug perspective offers additional views that can be used to troubleshoot an apppcation.
The java editor allows users to place break points in the java code. To set a break point, in the editor area right cpck on the marker bar and select Toggle Breakpoint.
Breakpoints are shown on the marker bar. They are also visible in the Breakpoints View.
When the execution of code reaches a break point the JVM suspends the execution of the program. At this point, you can inspect the memory and execute the program in a controlled manner.
When the execution of a program is paused, the debug view can be used to inspect the call stack.
The variables view can be used to inspect the value of variables.
The run menu has menu items that allow you to Resume execution, step over a pne of code, step into a function etc.
The picture given above shows the shortcut keys associated with actions such as Resume, Step Into and Step Over, etc.
Advertisements