Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » console redirection
console redirection [message #124612] Mon, 08 September 2003 19:02 Go to next message
Eclipse UserFriend
Is there a way I can do console redirection when I run my Java class
files within Eclipse. For example, I want to use a file called
input.txt as my standard input, but typing "< input.txt" in the program
arguments section of my java application configuration doesn't seem to work.

Thanks,

-mike
Re: console redirection [message #125652 is a reply to message #124612] Tue, 09 September 2003 11:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eric.rizzo.jibeinc.com

Michael Donikian wrote:

> Is there a way I can do console redirection when I run my Java class
> files within Eclipse. For example, I want to use a file called
> input.txt as my standard input, but typing "< input.txt" in the program
> arguments section of my java application configuration doesn't seem to
> work.

That's because that is operating system/command shell functionality, not
Java functionality.

I would recommend re-writing the app to accept the name of an input file
as an (optional?) parameter. Or write a wrapper that reads the input
file and feeds the underlying app that expects System.in input.

HTH,
Eric
--
Eric Rizzo
Software Architect
Jibe, Inc.
http://www.jibeinc.com
Re: console redirection [message #125896 is a reply to message #125652] Tue, 09 September 2003 13:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ThisisFake.Fakeness.xyz

On Tue, 09 Sep 2003 11:56:26 -0400, Eric Rizzo wrote:

> Michael Donikian wrote:
>
>> Is there a way I can do console redirection when I run my Java class
>> files within Eclipse. For example, I want to use a file called
>> input.txt as my standard input, but typing "< input.txt" in the program
>> arguments section of my java application configuration doesn't seem to
>> work.
>
> That's because that is operating system/command shell functionality, not
> Java functionality.
>
> I would recommend re-writing the app to accept the name of an input file
> as an (optional?) parameter. Or write a wrapper that reads the input
> file and feeds the underlying app that expects System.in input.
>
> HTH,
> Eric


i am sure its easier than that. In netbeans their was a launching
context, and you could put your command line options there. Their is
likely a command like option somewhere in Eclipse that launches the
'javaw' command. I dont know where though...
Re: console redirection [message #125933 is a reply to message #125896] Tue, 09 September 2003 13:57 Go to previous message
Eclipse UserFriend
"CL [dnoyeB] Gilbert" <ThisisFake@Fakeness.xyz> wrote in message
news:pan.2003.09.09.17.48.21.878997@Fakeness.xyz...
> On Tue, 09 Sep 2003 11:56:26 -0400, Eric Rizzo wrote:
>
> > Michael Donikian wrote:
> >
> >> Is there a way I can do console redirection when I run my Java class
> >> files within Eclipse. For example, I want to use a file called
> >> input.txt as my standard input, but typing "< input.txt" in the program
> >> arguments section of my java application configuration doesn't seem to
> >> work.
> >
> > That's because that is operating system/command shell functionality, not
> > Java functionality.
> >
> > I would recommend re-writing the app to accept the name of an input file
> > as an (optional?) parameter. Or write a wrapper that reads the input
> > file and feeds the underlying app that expects System.in input.
> >
> > HTH,
> > Eric
>
>
> i am sure its easier than that. In netbeans their was a launching
> context, and you could put your command line options there. Their is
> likely a command like option somewhere in Eclipse that launches the
> 'javaw' command. I dont know where though...

To use java instead of javaw:
See the JRE Tab for your launch configuration.
Specify to launch in an Alternate JRE and then you are able to specify the
Java executable that will be used.

Darins
Previous Topic:Launch delegate classpath problems
Next Topic:Moving a class to another package with Refactor feature?
Goto Forum:
  


Current Time: Tue Jul 15 14:13:13 EDT 2025

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

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

Back to the top