Step 8.3: Run HeIloWorld2


Step 8.3: Run HeIloWorld2

click to expand

It's time to use a little shortcut. Back in Step 8.1 you used the Run... option from the Run tool's dropdown. In subsequent steps, you selected all the defaults, and that was sufficient to run the program. Well, there's a quicker way to do all that. Use the Run As submenu and select the Java Application option. This will run the selected program as a Java Application with all the defaults. Let's do that now and watch how it works.

q 8.3(a) Left-click on HelloWorld2.java to select it.

q 8.3(b) From the Run tool dropdown, select Run As/Java Application.

click to expand
Figure 8.22: Use the Java Application option of the Run As submenu to quickly run HelloWorld2 with the default settings.
Note  

Now that you've run the HelloWorld program and created the HeIloWorld launch configuration, that configuration shows in the Run tool's dropdown list for easy access. As you add more configurations, they will be added as well, each with a number. The one marked number "1" will be the one selected if you just hit the Run tool button itself.

So you see the output as shown below. However, since there's very little real estate given over to the Console view, you might want to expand it. As always, to expand a view you just double-click on the title bar.

q 8.3(c) Double-click on the Console view title bar.

click to expand
Figure 8.23: The Console view is a little cramped, so double-click on the title bar to expand it.

You'll see a view like the one in Figure 8.24. Notice that there are three "Hello" lines: Hello 0, Hello 1 and Hello 2, because you set the initial count to 3.

click to expand
Figure 8.24: The Console view maximized. Double-clicking on the title bar again will restore the display.

Double-click on the title bar again to restore the display to its original view.

q 8.3(d) Double-click on the title bar again.

We're back to the original view, as shown in Figure 8.25. Okay, you've accomplished both editing and running. Now it's time for the last step in development debugging.

click to expand
Figure 8.25: The display restored.



Eclipse
Eclipse: Step by Step (Step-by-Step series)
ISBN: 1583470441
EAN: 2147483647
Year: 2003
Pages: 90
Authors: Joe Pluta

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net