Here's the answer to the same question at the JavaFAQ (http://www.afu.com/intro.html): Q. Is there a way to read a char from the keyboard without having to type carriage-return? A.You can do this in a GUI (e.g. in a text component). There is no pure Java technology way to do character-by-character I/O without using a GUI. Bug id #4075058 has been filed to request this feature. On Unix, if you enter 'stty cbreak' before running your java program, System.in will return character-by-character input. If you want to set this up from within a Java program, it is a bit tricky, since when the JVM executes a Runtime process, the process is not tied to any terminal.
subject: How can I read a single character from keyboard as soon as typed?