Bug 577236 - Ant Build Console not connecting to standard input
Summary: Ant Build Console not connecting to standard input
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 4.21   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-12 12:59 EST by Sean Morrison CLA
Modified: 2021-11-12 13:24 EST (History)
2 users (show)

See Also:


Attachments
Screenshot showing input (1.13 MB, image/png)
2021-11-12 12:59 EST, Sean Morrison CLA
no flags Details
Sample code demonstrating the issue (4.59 KB, application/zip)
2021-11-12 13:11 EST, Sean Morrison CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Morrison CLA 2021-11-12 12:59:35 EST
Created attachment 287504 [details]
Screenshot showing input

I have a simple Java program that creates a Scanner(System.in) reading an integer from standard input.  When running the program via Ant Build (<java jar="..." fork="true"> rule) in Eclipse (via Run or Run As), the program starts up normally, opens a Console, waits for input, but then nothing typed into the Console gets passed to the app.  Console does not appear to be connected to standard input.

I tested using defaults as well as trying different Runtime JRE's.  Confirmed that "Set an Input Handler" is checked on the Main tab under the Edit Configuration panel.  

The same code works when run outside of Eclipse (via ant or not).  It also works if I add an ant <input ..> prompting and pass it via <java .. inputstring="${var}"/> as it graphically prompts for input when run in Eclipse.

This bug may be specific to Mac.  I'm not set up to test on other platforms.
Comment 1 Andrey Loskutov CLA 2021-11-12 13:01:50 EST
Please attach your project with the ant script and the program.
Comment 2 Sean Morrison CLA 2021-11-12 13:11:40 EST
Created attachment 287505 [details]
Sample code demonstrating the issue

This attachment contains sample code demonstrating the issue.  Simply open the build.xml, right-click the "run" target to Run As... and select the "run" target (curiously defaults to the 'info' target).

Console will display and prompt for input.  Typing input into the console does not appear to get passed to the app.