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.
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?
Created attachment 26474 [details] A Java class with build.xml to underline the problem
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.
*** This bug has been marked as a duplicate of bug 50960 ***