File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
Author

[ANT] Keyboard input in forked java task

bloep
Greenhorn

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?
Tnx
Bart
[ 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [ANT] Keyboard input in forked java task