wood burning stoves*
The moose likes Ant, Maven and Other Build Tools and the fly likes [ANT] Keyboard input in forked java task Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "[ANT] Keyboard input in forked java task" Watch "[ANT] Keyboard input in forked java task" New topic

[ANT] Keyboard input in forked java task


Joined: Sep 23, 2003
Posts: 1
Is it possible to read input from the keyboard in a forked <java> task? When I execute a program that copies a line from the keyboard to the screen with fork="false" the program works OK. When I execute the same program with fork="true" the program hangs. Does anyone knows how to re-route the System.in of the new JVM to the keyboard?
BTW. I read Ant 1.60 might directly support re-routing of System.in . Does anyone know more about this?
[ September 23, 2003: Message edited by: Bart Golsteijn ]
Lewin Chan
Ranch Hand

Joined: Oct 10, 2001
Posts: 214
This is slightly off your actual topic (I don't actually believe it is possible for a forked java task), but you could try re-writing your java program (if you have access to the source that is) as an Ant Task...
You can get/use keyboard input by using a combination of DefaultInputHandler and the various InputRequest classes.

I have no java certifications. This makes me a bad programmer. Ignore my post.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: [ANT] Keyboard input in forked java task
Similar Threads
Synonym for System.in
Preventing Ant to hang on a blocked thread
Forked Program
I know -- I should read the FAQ first...
java program to accept user input, ant