How to make Eclipse prompt me for command line arguments

Eclipse

Eclipse Problem Overview


I know I can configure command line arguments in the Run configuration but I want to run a java file multiple times with different command line arguments. It's a pain to change the Run Configuration every time.

Is there a way I can make Eclipse prompt me for command line arguments every time I run the program?

Eclipse Solutions


Solution 1 - Eclipse

Add string_prompt as a Program Argument in the Run configuration.

 ${string_prompt}

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

These are available through the Variables button on the (x)= Arguments tab of the Run Configuration dialog.

Solution 2 - Eclipse

This is an old question, but since I really don't see this extra info anywhere else

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

And that will pop up a window asking 'Please input a value for My Prompt Text' and then with a default value of 'Default Value'.

Solution 3 - Eclipse

In addition you can add a string to the prompt by using ${string_prompt:My Prompt Text} which will show the dialog box with 'Please input a value for My Prompt Text'.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRahulView Question on Stackoverflow
Solution 1 - EclipseKen GentleView Answer on Stackoverflow
Solution 2 - EclipseCalebView Answer on Stackoverflow
Solution 3 - EclipsebigcmosView Answer on Stackoverflow