Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

BufferedReader readLine() method does not block until input is entered

807588Apr 15 2009 — edited Apr 15 2009
Hello,

I am stuck with an issue. This is on solaris machine. I am trying to read password from the user in order to decrypt some file.
The problem is, the readLine() method does not wait until the user enters password. It returns null and continues. Below i paste the code.
System.out.print(prompt);
        BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
        String password =  b.readLine();
        return password;
and the solaris OS details

bash-3.00# uname -a
SunOS Ilabsun160 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Blade-100

Any help on this is is greatly appreciated.

Thanks a lot
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 13 2009
Added on Apr 15 2009
6 comments
1,121 views