I am running OSX 10.11 with IntelliJ 14.1.15.
I have a programme which takes a txt file as an argument. I can run it from the terminal through java Searc
You need to go in the menu Run -> Edit configurations.
Select your configuration and add the parameters in the field Program arguments
The field Program arguments is what appears after the class name from command line. For example:
java MyMainClass ProgramArgument1 ProgramArgument2 ProgramArgument3
in your example
java SearchCmd test.txt
the program argument is test.txt
Note: Use an absolute path or check that the working directory is the directory containing your file