Simulate input from stdin when running a scala program in intellij

StephenBoesch picture StephenBoesch · Aug 26, 2013 · Viewed 16.6k times · Source

Is there any way to configure the command line args to intellij for stdin redirection?

Something along the lines of:

Run | Edit Run Configurations | Script Parameters

/shared/java/paf-rules.properties 2 < /shared/java/testdata.csv

Answer

vikingsteve picture vikingsteve · Aug 26, 2013

Unfortunately, no - at least not directly in run configurations.

The best you can do, afaik, is either to:

  • modify your script / program to run either with no args (reads System.in) or with a filename argument (reads the file)

  • make a wrapper script / program which acts in the manner above.

Hope this helps,

vikingsteve