3

I'm developing a Java program in IntelliJ IDEA 13.1. To run the program at command-line

$ echo 1 a b | java MyProgram 3

The 3 is an argument, and when MyProgram started, it expects 1 a b being input at stdin. How do I set up a Run/Debug Configuration in IntelliJ IDEA so the above can be simulated in the IDE?

user78219
  • 31
  • 1
  • 4
  • Not sure how IntelliJ IDEA stores projects, but would it be possible to open the shell, `cd` to where the class files are stored in the project directory, and run the command there? – McLovin Jul 11 '14 at 01:06
  • This is not what I'm asking. Sorry. – user78219 Jul 11 '14 at 01:33
  • I am not sure you can piping is usually handled by the shell. You could add a test mode where it reads the data from a file instead. – BevynQ Jul 11 '14 at 01:41
  • 1
    possible duplicate of [Simulate input from stdin when running a program in intellij](http://stackoverflow.com/questions/18437181/simulate-input-from-stdin-when-running-a-program-in-intellij) – merlin2011 Jul 11 '14 at 07:45

0 Answers0