How to pass contents of a text file as command line arguments for a java application?

Sheena Ong

New member
We were told to test a java project of ours by

doing entering this into the command prompt... java SLSim < sample-input.txt

This is supposed to read the contents of the text file line by line as if each were command line arguments. However, whenever I type exactly that I keep getting an ArrayOutofBounds exception or something like that. Normal arguments work like.. "java SLSim lineup" so I don't think it's so much an issue with my code...I'm probably missing something..but what?

Thanks in advance!
 
Back
Top