So now that we have run our program, let's see what
happens exactly when you run a program within Eclipse. And to
do that I'm going to use the menu over here which is
the Run menu and I'm going to select Run Configurations, and this
brings up a window where you can change or run configurations.
Well first of all, you can see that here on the
left under Java application. Eclipse automatically created a Hello World run
configuration for our program. And this is where you can configure
the different parameters for your execution. For example,
you can select the main class. So here
it's, obviously, edu.gatech.HelloWorld. You can define different program
arguments. We don't have any for now. You can
also pass arguments to the virtual machine. You
can define which Java runtime environment you want to
use, Classpath and other environmental options. So let's
now try to pass some arguments to our program.
So for example here, I am just going to write George as
a possible parameter. I say Apply so that modify the configuration and
if i run the program of course, the output is not changing
because my program does not use the argument. But, let's see if
we do use the argument, what happens. So I'm going to slightly
modify the final program so that now, instead of printing hello
world, it will print hello followed by the first argument that I
will pass to the program. And if I do that, and I
go and I run the program, what I get is exactly what I
was expecting, which is Hello George. So this is the way in which you
can pass arguments to your execution, which
is something that might come in handy
for some other projects. When you need to run some code with an argument.