This is a step-by-step guide showing how to specify command-line arguments in jGrasp.
Go to Build -> Run Arguments
, which is a checkbox you'll need to select.
An illustrative screenshot is provided below.
After selecting “Run Arguments
” in the previous step, a new area will appear in jGrasp where you can type in your command-line arguments.
The position of this area is shown in the screenshot below.
In this area, you can type in your command-line arguments. Each argument is separated by whitespace (e.g., a space). An example is shown in the screenshot below, where three arguments have been provided, namely:
foo
bar
baz
The screenshot above also shows what happens if the given program is run with these arguments, shown in the lower red box. As shown, the arguments are passed directly to the program via the command-line:
java PrintFirstThreeArgs foo bar baz
Because the shown program merely prints out the first three arguments it receives, this program produces as output:
foo bar baz
...since the given arguments were foo
, bar
, and baz
, respectively.