Oftentimes programs will not function as expected because the programmer possibly forgot to initialize a variable, made a mistake setting conditions such that a loop will never terminate, or did not account for a method call that returns null. Fixing these errors takes very little time, but finding the error in the code can be a very difficult task. The concept of debugging aims at speeding up the locating process of programming flaws.
Debugging allows the programmer to set break points in the code. When executing the program in debug mode, Eclipse will run the program normally, but it will pause (not stop) execution at the first break point. The programmer can then observe the state of all currently declared variables. Moreover, the programmer can step through the code to see how the next instructions will affect the variables. Execution can be resumed and the program will either terminate normally, or Eclipse will stop at the next break point it detects.
In order to set a break point, simply right click on the gray margin
to the left of the line of code in the editor. A small context menu
should open, which will allow you to add a break point. To start the
debugging process select the dropdown menu with the icon
and choose
Debug Application (or whichever type of program you are working on).

Once you have started the debugging process, Eclipse will switch to the debugging perspective. This perspective may seem complex and confusing at the beginning, but this should not discourage you from using it. Here are the key elements you should be familiar with:
1. Debug view
2. Variables view (marked in blue on the right side)
3. Editor view
4. Console view (bottom blue rectangle)
