Running a Java program with Command-line arguments in Eclipse.

 

Chose Run à Run …  to bring up a dialog like this:

 

 

Set the name, project, and Main class to be what you want (as shown here for Colorize, if we want  the SlashSlash.java file to be used as input.).

 

Click the Arguments tab and type in the command-line argument.

 

 

Click the Run button.  Save this launch configuration when asked to do so.

 

There is a button at the top left of the Run dialog that lets you Duplicate the current Launch Configuration.  Then you can edit the duplicate copy instead of having to start from scratch. This allows you to have a different launch configuration for each command-line argument that you want to use.  These choices also show up when you click the Run button in the ToolBar:

 

Where to put your input files (and where to look for the output files): In the main folder of your Colorize project.