Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[ANT] Keyboard input in forked java task

 
bloep
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic