You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Sadu Venu Gopal <sa...@aztec.soft.net> on 2002/10/07 06:34:02 UTC
java class is unable to receive user input when fork="yes"
Hi,
I have a simple class, which will take user input from System.in
When I use
<java classname="Client" fork="no"><java/>
program is receiving the user input and working fine.
If I use fork="yes" the same program is not receiving the user input.
Is there any why by which I can achieve this even if fork="yes" ???
Example Code (Client.java):
BufferedReader bReader =
new BufferedReader(new InputStreamReader(System.in));
System.out.println("END to come out from the program");
msg = bReader.readLine();
while(!msg.equalsIgnoreCase("END")){
System.out.println("Echo:"+msg);
msg = bReader.readLine();
}
bReader.close();
Regards,
Venu.
ph: 5522892 Ext: 280
Re: java class is unable to receive user input when fork="yes"
Posted by Steve Loughran <st...@iseran.com>.
um, I didnt know that the java task would receive input when fork=no; if it
did, it was not intentional.
For your particular problem, the answer is 'not unless you can code a
solution'
----- Original Message -----
From: "Sadu Venu Gopal" <sa...@aztec.soft.net>
To: <an...@jakarta.apache.org>
Sent: Sunday, October 06, 2002 9:34 PM
Subject: java class is unable to receive user input when fork="yes"
> Hi,
>
> I have a simple class, which will take user input from System.in
> When I use
> <java classname="Client" fork="no"><java/>
> program is receiving the user input and working fine.
>
> If I use fork="yes" the same program is not receiving the user input.
>
> Is there any why by which I can achieve this even if fork="yes" ???
>
>
> Example Code (Client.java):
> BufferedReader bReader =
> new BufferedReader(new InputStreamReader(System.in));
> System.out.println("END to come out from the program");
> msg = bReader.readLine();
> while(!msg.equalsIgnoreCase("END")){
> System.out.println("Echo:"+msg);
> msg = bReader.readLine();
> }
> bReader.close();
>
> Regards,
> Venu.
> ph: 5522892 Ext: 280
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>