Entering Command-line Arguments

   

When using an executable that requires startup arguments to debug, you can type these arguments at the command line, or from within the development environment.

The following explains how to use the Custom options in the environment’s Launch tab of the project’s Properties dialog box. The Properties dialog box for an open project can be accessed from the Project menu.

To enter command-line arguments

  1. From Project Explorer, double-click a .java file to load it into the Text editor.

  2. On the Project menu, click <Project name> properties to display the Properties dialog box.

  3. On the Launch tab, click the Custom radio button.

    The Custom options on this tab provide a place to enter the command line arguments for your application.

  4. In the Arguments text box type the information you want to pass to your program.

    For example, if your program accepted a date in the format of MM DD YY, July 10, 1997 would be entered as 7 10 1997.

Note   The Arguments text box may have some viewer options displayed. If you have a specific reason to change these preset options, do so now and enter the date after them.

Now you are ready to debug your application. Setting a breakpoint before starting the integrated debugger is one way to start this process.