How to get Eclipse to request command line arguments

I know that I can configure the command line arguments in the "Run" configuration, but I want to run a java file with different command line arguments several times. It hurts to change the launch configuration every time.

Is there a way to get Eclipse to request command line arguments every time the program starts?

+74
eclipse
Nov 24 '08 at 2:08
source share
3 answers

Add string_prompt as Program Argument to the Run configuration.

  ${string_prompt} 

There are also file_prompt and folder_prompt if you want files / folders specifically.

They are available using the Variables button on the (x)= Arguments tab of the Run Configuration dialog box.

+89
Nov 24. '08 at 2:29
source share

This is an old question, but since I really do not see this additional information elsewhere

You can also enter ${string_prompt:My Prompt Text:Default Value}

And a window will pop up asking, "Please enter a value for My Prompt Text," and then with the default value, "Default Value."

+55
Jul 11 '11 at 15:31
source share

Alternatively, you can add a line to the prompt using $ {string_prompt: My Prompt Text}, which displays a dialog box with the field "Please enter a value for the prompt text."

+18
Oct 12 '09 at 20:19
source share



All Articles