• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot get instance of Console

 
Sahil Manchanda
Ranch Hand
Posts: 41
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my system is not providing me with an instance of console ... (Console s = System.console();).. what to do?
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sahil Manchanda
Ranch Hand
Posts: 41
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
o yes i was .. thankyou!
 
Don Redd
Ranch Hand
Posts: 82
Eclipse IDE Java Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic