Skip to main content



      Home
Home » Newcomers » Newcomers » Piping argument in Eclipse
Piping argument in Eclipse [message #81130] Mon, 27 June 2005 11:27 Go to next message
Eclipse UserFriend
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 17:18 Go to previous message
Eclipse UserFriend
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!
Previous Topic:Debugging problem: Source not found
Next Topic:Eclipse doesn't start
Goto Forum:
  


Current Time: Wed Jul 02 02:33:21 EDT 2025

Powered by FUDForum. Page generated in 0.51765 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top