Piping argument in Eclipse [message #81130] |
Mon, 27 June 2005 15:27 |
Eclipse User |
|
|
|
Originally posted by: xrli.uwaterloo.ca
I am trying to run a java program using piping parameters, such as the
command line
java Main <test.in >test.out
I cannot figure out how to set these arguments in Eclipse, and I couldn't
find anything on Google. Does anyone have any idea?
Thanks!
|
|
|
Re: Piping argument in Eclipse [message #81279 is a reply to message #81130] |
Mon, 27 June 2005 21:18 |
Eclipse User |
|
|
|
Originally posted by: chaves-do-not-spam.inf.ufsc.br
You want to launch Main using Eclipse, or you want to launch Main from
another Java application you wrote?
For the former, the UI does not allow that, but you can write a small
application that first connect System.in and System.out with the the input
and output files, and then call Main.main().
For the latter, you can launch a single process with Runtime.exec. That
reditrection syntax is interpreted by the shell itself, not the exec call.
What you can do (at least on Windows) is to run the shell passing as
argument a string with the command line you want to run. Something along
these lines:
Runtime.getRuntim().exec(new String[] {"cmd.exe","/c","java "});
Robin Li wrote:
> I am trying to run a java program using piping parameters, such as the
> command line
> java Main <test.in >test.out
> I cannot figure out how to set these arguments in Eclipse, and I couldn't
> find anything on Google. Does anyone have any idea?
> Thanks!
|
|
|
Powered by
FUDForum. Page generated in 0.06941 seconds