feeding input to a java process from a batch file

Posted by YGL on Stack Overflow See other posts from Stack Overflow or by YGL
Published on 2010-05-02T15:00:18Z Indexed on 2010/05/02 15:07 UTC
Read the original article Hit count: 207

Filed under:
|
|
|

If I have a simple java program that processes lines of text from standard input, then I can run it with the following script:

@Echo off
java Test < file.txt
pause
exit

The script redirects lines of input from a separate file.

Is there a way that I can avoid having to use an extra file? Or is this the easiest way?

Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about batch-file