How to make IntelliJ prompt me for command line arguments

Viewed 15460

In Eclipse, you can provide the program argument ${string_prompt} in your run configuration to have it prompt for the command line arguments.

Is there a way to do this in IntelliJ?

3 Answers

Starting from versions 2018.3 and 2019.1, IntelliJ now supports macros in Run configurations. You can use $Prompt$ anywhere in the VM Options, Program arguments, etc. fields, and it will behave just like ${string_prompt} in Eclipse -- it will prompt you for parameters when the configuration is run.

Based on using Intellij IDEA 2020.3, we can set the configuration to prompt for program arguments at the program arguments field

Right click the program and then choose menu More Run/Debug > Modify Run Configuration

Look for the Program arguments text field

Type $Prompt$ at the Program arguments text field and then click OK

Related