read unbuffered from STDIN

Ronald Klop ronald-lists at klop.ws
Tue Mar 3 10:23:14 UTC 2015


On Fri, 27 Feb 2015 16:00:46 +0100, Matthias Apitz <guru at unixarea.de>  
wrote:

> El día Friday, February 27, 2015 a las 03:20:14PM +0100, Matthias Apitz  
> escribió:
>
>> This does not work in FreeBSD+eclipse and as well not when started as
>>
>> $ javac reader.java
>> $ java -cp . reader
>
> It does work when one does:
>
> $ stty raw ; java -cp . reader
> Enter characters, 'q' to quit.
>                               a
>                                a
>                                 a
>
> Any ideas how to issue the 'stty raw' from within the java classes?
>
> 	matthias
>

I have never used them, but java.io.Console and java.util.Scanner might  
solve your issue.
http://docs.oracle.com/javase/7/docs/api/index.html?java/util/Scanner.html
http://docs.oracle.com/javase/7/docs/api/index.html?java/io/Console.html

Regards,
Ronald.


More information about the freebsd-java mailing list