| Author |
Cannot get instance of Console
|
Sahil Manchanda
Ranch Hand
Joined: Jul 24, 2012
Posts: 36
|
|
my system is not providing me with an instance of console ... (Console s = System.console();).. what to do?
|
 |
gurpeet singh
Ranch Hand
Joined: Apr 04, 2012
Posts: 867
|
|
|
you are probably running your program in an IDE. try running your program in commandline and you will definitely get an instance of Console. for more information refer javadocs for Console class at http://docs.oracle.com/javase/6/docs/api/java/io/Console.html
|
OCPJP 6(100 %) OCEWCD 6(91 %)
|
 |
Sahil Manchanda
Ranch Hand
Joined: Jul 24, 2012
Posts: 36
|
|
o yes i was .. thankyou!
|
 |
Don Redd
Ranch Hand
Joined: Jan 05, 2012
Posts: 82
|
|
|
In extension to what gurpeet said. IDE's generally uses javaw.exe (which doesnt have a console associated) and not java.exe( which have a associated console)
|
 |
 |
|
|
subject: Cannot get instance of Console
|
|
|