bobrivers2003
Technical User
Hi,
I have created a class that executes an ant script. If the ant does not require an input it works fine. However, sometimes the script will ask a qustion from which the user must type either y or n followed by return.
When my class runs this file it hangs when it gets to this bit.
I understand that I may have to use something along the line of bufferedReader. My question:
If I use
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
and
br.readLine();
it requires the user to enter something in. I want java to automatically type y or n followed by return. Does any body know the area that I need to be looking in to solve this issue?
Any help would be greatly appreciated.
Many Thanks
I have created a class that executes an ant script. If the ant does not require an input it works fine. However, sometimes the script will ask a qustion from which the user must type either y or n followed by return.
When my class runs this file it hangs when it gets to this bit.
I understand that I may have to use something along the line of bufferedReader. My question:
If I use
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
and
br.readLine();
it requires the user to enter something in. I want java to automatically type y or n followed by return. Does any body know the area that I need to be looking in to solve this issue?
Any help would be greatly appreciated.
Many Thanks