I am trying to read multiple inputs from the console in Groovy 1.7.10 in Spring Source Suite 2.7.1 (multiple in.readLine()), but the console only seems to allow me to input the first entry, puts in a blank for the second entry and moves to let me enter the third entry, puts in a blank for the fourth entry etc. The following is the code that I'm using.
System.in.withReader {reader ->
print "w: "
def w = reader.readLine()
print "x: "
def x = reader.readLine()
print "y: "
def y = reader.readLine()
print "z: "
def z = reader.readLine()
}
The output that I am getting is as follows.
w: 1 x: y: 2 z:
As you can see, it lets me enter the first line, puts a blank for the second, and lets me enter the third input, and puts a blank for the fourth. Does this have to do with me pressing "enter" when entering my input? I would think not since readLine() is supposed to read a line and retrieve the text upto but not including the carriage returns. Any help is appreciated.
Thanks,
Juan