Hi all

I was experimenting with LAB-1003 hands-on, where we're taught to get 
input from keyboard accessing stardard input in a buffered way. But the 
way I see it, there are two problems:

- We have to handle the exceptions from such generic classes like 
BufferedReader and InputStreamReader.
- Appears complex to grasp to the java newcomer

I then found out that since Java 6.0 there's a new java.io class, 
Console, whose object is returned by System.console():
public static Console 
<http://java.sun.com/javase/6/docs/api/java/io/Console.html> *console*()
Returns the unique |Console| 
<http://java.sun.com/javase/6/docs/api/java/io/Console.html> object 
associated with the current Java virtual machine, if any.
*Returns: T*he system console, if any, otherwise null.

More information on Console's API javadoc's. It almost seems like 
something every java programmer been expecting. The problem is that, 
neither using Netbeans not Eclipse, the System console seems to be 
unavaliable. It works fine on the command line, but System.console() 
returns null when running through the IDE.

I'm guessing that's because the JVM is handled in a different way. But I 
can't quite understand it. Can anyone explain why it doesn't work? Or if 
is there a workaround to make it work?

Hugs




--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to