Bug 50529 - Runtime reading data in a Java class
Summary: Runtime reading data in a Java class
Status: RESOLVED DUPLICATE of bug 50960
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.8.2
Hardware: PC All
: P2 minor (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-29 10:06 UTC by Scheiber Erno
Modified: 2012-01-19 15:02 UTC (History)
1 user (show)



Attachments
A Java class with build.xml to underline the problem (1.06 KB, text/plain)
2011-01-11 01:00 UTC, Scheiber Erno
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scheiber Erno 2010-12-29 10:06:38 UTC
The <java> task does not allow to run a class with code like
=========================
import java.util.Scanner;
....
Scanner scanner=new Scanner(System.in);
long a=nextLong();
....
=========================
This was OK in ant 1.8.1.
Comment 1 Jesse Glick 2011-01-07 18:30:16 UTC
Seems to be working for me with 1.8.2 on Ubuntu with fork="true". What exact OS are you running? Do you have a complete test case to reproduce?
Comment 2 Scheiber Erno 2011-01-11 01:00:33 UTC
Created attachment 26474 [details]
A Java class with build.xml to underline the problem
Comment 3 Jesse Glick 2012-01-19 14:47:22 UTC
Reproducible with that script on Linux; the test program does get the input, but only after sending Ctrl-D.

Not sure what specifically changed in 1.8.2 but in general you should not use <java> to run programs with nontrivial stdio, since Ant processes it to fit into the logging system.
Comment 4 Jesse Glick 2012-01-19 15:02:47 UTC

*** This bug has been marked as a duplicate of bug 50960 ***