Close
Register
Close Window

Data Structures & Algorithms

Chapter 12 Programming Tutorials

Show Source |    | About   «  12.2. Parsing Command Line Parameters In Your Program   ::   Contents   ::   12.4. Installing the Web-CAT Submission Plug-in for Eclipse  »

12.3. Using Command Line Parameters in Eclipse

12.3.1. Using Command Line Parameters in Eclipse

Sometimes your projects developed in Eclipse need to test invoking the program through command line parameters. You can view a tutorial of the material.

1. Open your project and select the drop down arrow next to the Green Run Arrow (circled below). If you cannot see this arrow then you may be in the wrong Eclipse perspective. Select Window -> Open Perspective -> Java.

Step 1

2. You will now see a Run Configurations window. Select the Java Application section. Now depending on whether or not you have ran this project previously you may or may not have a configuration saved. If you have one saved already then continue on to Step 3. Otherwise select Java Application and right click on new.

Step 2

3. You will now have a profile inside the Java Application window. Select the arguments tab and add the command line arguments that you would like to run (in this case I am adding the -h argument).

Step 3

4. You may now hit Run and the program will launch with the parameters you provided. The Console window will display any output from your program.

Step 4

5. To change the parameters you can either create a new profile or edit an existing profile.

   «  12.2. Parsing Command Line Parameters In Your Program   ::   Contents   ::   12.4. Installing the Web-CAT Submission Plug-in for Eclipse  »

Close Window