ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22347] - java task with BufferedReader hangs
Date Tue, 12 Aug 2003 15:00:22 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22347>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22347

java task with BufferedReader hangs





------- Additional Comments From conor@cortexebusiness.com.au  2003-08-12 15:00 -------
In Ant 1.5, you can use the <input> task to collect input from the user. Not
sure what else your java task does but if the input is for use in Ant, use <input>.

It would also be good to have a look at the Ant 1.6 nightly builds and try out
the input management there.

I'm not sure why it is not working for you. This is the code I used

import java.io.*;

public class Test {
    static public void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
            System.out.println("Enter a line");
            String line = br.readLine();
            System.out.println("Line is " + line);
        }
        catch (IOException ioe) {
            ioe.printStackTrace();
        }
    }
}

I get the following results

Ant 1.5.3, forked - hangs
Ant 1.5.3, not-forked => works
Ant 1.6alpha, forked => prints Line is null without waiting
Ant 1.6alpha, not-forked => works
Ant 1.6alpha, not-forked, -noinput flag => fails with EOF exception
java.io.EOFException: No input provided for project

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message