Hello
I'm running a very simple console app. When I try to stop it with CTRL-C it doesn't stop immediatly but prints a line and then dies.
This is the code:
import java.io.Console;
class TestCtrlC {
public static void main(String[] args) {
final Console console = System.console();
String line;
do {
System.out.println("Write someting");
line = console.readLine();
} while (line == null);
}
}
And this the output:
D:\>java TestCtrlC
Write something <- Here I press ctrl-c without typing anything else.
Write something
D:\>
D:\>ver
Microsoft Windows XP [Versión 5.1.2600]
D:\>java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)
Any ideas about this behaviour?
Thanks