ASF Bugzilla – Attachment 28338 Details for
Bug 52681
User doesn't see what's typed until enter is pressed on System.in for forked java task
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
sample build.xml file
build.xml (text/xml), 1.78 KB, created by
Denys M
on 2012-02-16 11:27:06 UTC
(
hide
)
Description:
sample build.xml file
Filename:
MIME Type:
Creator:
Denys M
Created:
2012-02-16 11:27:06 UTC
Size:
1.78 KB
patch
obsolete
><?xml version="1.0" encoding="UTF-8" standalone="no"?> ><project basedir="." default="test-all" name="test"> > ><!-- > Build file to demonstrate a bug with ant version 1.8.2 and latest nightly versions running in Windows 7 > using the Java version 1.6.0_30-b12. > > Do "ant bad" to run a Java app that just reads in a line of text & echos it. > If run in a forked JVM the program hangs waiting for input. > > Doing "ant good" to run it in a non-forked JVM works fine, as does directly > executing it with the command "java Test". > > Everything works fine with ant version 1.8.1, doesn't work on ant version 1.8.2 and nightly 1.8.3 >--> > ><target name="compile"> > <echo> >ant.version = ${ant.version} >ant.home = ${ant.home} >ant.library.dir = ${ant.library.dir} >ant.java.version = ${ant.java.version} > </echo> > <echo file="Test.java"> >import java.io.*; >public class Test { > public static void main(String[] args) throws IOException { > System.out.println("\nPlease enter some text and hit return:"); > String line = new BufferedReader(new InputStreamReader(System.in)).readLine(); > System.out.println("Text entered = " + line); > } >} > </echo> > <javac srcdir="." > destdir="." > includeAntRuntime="no" > includeJavaRuntime="no" > debug="false" > fork="yes"/> ></target> > ><target name="bad" depends="compile"> > <echo message="This will hang: calling Java with fork=true"/> > <java classname="Test" > classpath="." > fork="true" > failonerror="true"/> ></target> > ><target name="good" depends="compile"> > <echo message="This will work: calling Java with fork=false"/> > <java classname="Test" > classpath="." > fork="false" > failonerror="true"/> ></target> > ><target name="test-all" depends="good, bad"/> > ></project>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 52681
: 28338