How To Use Command Line Arguments in Eclipse |
LINKS INTO DOCUMENT BELOW | |
---|---|
Introduction | Detailed Instructions using Welcome.java |
Instructions using Args.java | Instructions using TempConversion.java |
In the window shown below,
notice that the Welcome Java application
is highlighted.
In the large subwindow of the Run window,
there is a set of tabs,
labelled Main, Arguments, JRE, etc.
Notice that the Main tab is highlighted.
For the Welcome program,
only one input argument value is needed:
the first name of a new Java student.
For this run, we have chosen Sarah as
the name of this student.
Notice where it has been typed in.
This is where all command line arguments should
be entered.
These values remain the same for all runs,
until they are changed in this same window.
For the Args program,
eight input argument values are needed.
For this run, we have chosen eight random sets of
characters, some numeric, some alphabetic, as input values:
namely, 101, Joe,
Larry, 93214,
3.145, 66,
ABCDEF, xxxxx.
Notice that there is at least one space between every
two arguments.
For the TempConversionCL program,
only one input argument value is needed:
the value of the Celsius temperature.
For this run, we have chosen 28.5 for
this value of the Celsius temperature.