ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.5 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://www.cs.colostate.edu/helpdocs/eclipseCommLineArgs.html |
| Last Crawled | 2026-03-25 04:28:34 (16 days ago) |
| First Indexed | 2017-08-23 06:56:07 (8 years ago) |
| HTTP Status Code | 200 |
| Meta Title | How To Use Command Line Arguments in Eclipse |
| Meta Description | null |
| Meta Canonical | null |
| Boilerpipe Text |
Click on Run -> Run (not Run Last Launched ) .
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.
Click on the Arguments tab.
This action brings up a window
with a few places to enter values.
You want to type in all your input values
into the Program arguments window,
with spaces (blank characters) between each value.
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.
Then just click Apply , followed by Run .
The screenshot below shows the output in the console window.
|
| Markdown | | | |
|---|---|
|  | How To Use Command Line Arguments in Eclipse |
***
***
| **LINKS INTO DOCUMENT BELOW** | |
|---|---|
| [**Introduction**](https://www.cs.colostate.edu/helpdocs/eclipseCommLineArgs.html#INTRO) | [**Detailed Instructions using Welcome.java**](https://www.cs.colostate.edu/helpdocs/eclipseCommLineArgs.html#WELCOME) |
| [**Instructions using Args.java**](https://www.cs.colostate.edu/helpdocs/eclipseCommLineArgs.html#ARGS) | [**Instructions using TempConversion.java**](https://www.cs.colostate.edu/helpdocs/eclipseCommLineArgs.html#TEMPCONVERSION) |
***
***
[How To Use Command Line Arguments in Eclipse]()
The main example used in these notes is the [**Welcome**](https://www.cs.colostate.edu/helpdocs/Code/Welcome.java) class,
developed in the **WelcomeToJava** Eclipse project.
This program accepts one input argument value,
which is automatically assigned to the first value
in **String\[\] args**, called **args\[0\]**.
*(Computer people tend to count from **0** and not **1**.)*
Study the program for a few minutes to find where **args\[0\]** is used.
Notice that it is of type **String**.
The detailed instructions are in the next section,
complete with screenshots from the **Welcome** class in Eclipse.
Two other example programs are described in the last section.
***
[Detailed Instructions for Command Line Arguments in Eclipse Example: Welcome.java]()
1. Basically, it's simple.
Click on **Run** -\> **Run** *(not **Run Last Launched**)*.
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.

2. Click on the **Arguments** tab.
This action brings up a window
with a few places to enter values.
You want to type in ***all*** your input values
into the **Program arguments** window,
with spaces *(blank characters)* between each value.
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.

3. Then just click **Apply**, followed by **Run**.
The screenshot below shows the output in the console window.

***
### [Another Example of a Java program using Command Line Arguments: Args.java]()
Another example is the [**Args**](https://www.cs.colostate.edu/helpdocs/Code/Args.java) class,
developed in the **TestArgs** Eclipse project.
This program requires ***more*** than one command line argument.
1. Click on **Run** -\> **Run** *(not **Run Last Launched**)*.
2. Click on the **Arguments** tab,
in the large subwindow of the **Run** window.
This action brings up the **Program arguments** window,
where you should type in your input values.
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.

3. Then just click **Apply**, followed by **Run**.
The screenshot below shows the output in the console window.

4. If you were to click on **Run** -\> **Run Last Launched** at this point,
the same command line arguments would be used automatically,
producing the same output.
5. To change the value of the command line argument,
you need to click on **Run** -\> **Run** again,
and change the argument(s) in the **Program assignment** window.
***
[Further Example of a Java programs using Command Line Arguments: TempConversion.java]()
Yet another example is the [**TempConversionCL**](https://www.cs.colostate.edu/helpdocs/Code/TempConversionCL.java) class,
developed in the **TempConversion** Eclipse project.
This program requires only ***one*** command line argument,
but this value must be converted from a **String**
to a **double** value to be used arithmetically.
1. Again, click on **Run** -\> **Run** *(not **Run Last Launched**)*.
2. Click on the **Arguments** tab,
in the large subwindow of the **Run** window.
This action brings up the **Program arguments** window,
where you should type in your input values.
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.

3. Then just click **Apply**, followed by **Run**.
The screenshot below shows the output in the console window.

***
***
**Copyright \&\#169 2003: Colorado State University for Computer Science.** All rights reserved.
*** |
| Readable Markdown | null |
| Shard | 173 (laksa) |
| Root Hash | 487643243006489773 |
| Unparsed URL | edu,colostate!cs,www,/helpdocs/eclipseCommLineArgs.html s443 |