Are you ready to see the fruits of your labor? Ready for the payback for all that hard work? Well wait no more; it's time to start running things!
In this step, you'll run your program. Not only that, you'll set a breakpoint, start the program in debug mode, stop at the breakpoint, inspect and change a variable, and continue execution ”all the steps needed to debug your programs.
Note | Some toolbar buttons , such as the Run button, also have a small dropdown symbol to the right. This dropdown brings up a secondary menu of options. The primary button usually will rerun the most recently selected option. |
q 8.1 (a) Select HelloWorld.java if it is not already selected.
q 8.1(b) From the main tool bar, select the Run tool's dropdown.
q 8.1(c) Select Run ...
This brings up the "launch configuration" screen. There are several options here, but we will concentrate on the Java Application option. I hope to write an entire book someday on working with JUnit, but that's another issue for another day.
q 8.1(d) Select Java Application and click New.
The next page of the wizard will come up. This is a very complicated page, because you can set all kinds of things. Note that several defaults are already set, such as the Project name (Hello) and the Main class to run (HelloWorld). As long as you don't need to pass parameters or set runtime JVM characteristics, these defaults are often good enough.
Note | There are times when you need to set certain runtime characteristics. We will see this when we use the SWT (Standard Widget Toolkit) classes in Step 9. But for these first examples, and in fact for many programming situations, the defaults are acceptable. |
q 8.1(e) Leave the defaults as they are and press Run.
And here are your results! Since this very simple program does nothing more than print to the standard output, the results show up in the console window. The console window magically pops up on top of the Tasks view, and shows you the results of your programming.