Executing a Program

Time to run a program? Right-click on your driving class (the one with the main method in it), and choose Run As > Java Application. For the lazy, this can also be accomplished with Shift-Alt-X J. To be precise, the first three keys are struck simultaneously, then released, and then you hit J. If it wasn't already there, the Console view will appear at the bottom of your screen and display any output to System.out or System.err (i.e. standard out and standard error).

Output from the Console

In Eclipse's top toolbar you will also see a green "Play" button (no briefcase). Clicking this button will run the last executed program. If you click on the little downward-pointing triangle on its right side, you will get a list of recently run programs as well as an option to open the Run window.

Executing using the Run button

I don't forsee the Run window being too useful at this stage in the game. However, if you would ever like to run a program and give it command line arguments while in Eclipse, you can right-click, select Run As > Run..., and then click on the Arguments tab in the resulting window. In the text field marked "Program Arguments" you can type a space-separated list of arguments.

Using the Run window to specify command-line arguments

For instance, typing "foo bar baz" into the "Program Arguments" box and then running your program would have the same effect as typing "java [program name] foo bar baz" into the command line.