Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Why System.console() returns Null?(Method System.console() not working according expectations.)
Why System.console() returns Null? [message #823542] Sun, 18 March 2012 13:29
boris starchev is currently offline boris starchevFriend
Messages: 3
Registered: March 2012
Junior Member
If this fragment is executed in Eclipse Classic 3.7.2,we have received "No console."
Why?

import java.io.Console;
import java.io.IOException;

public class Password {

public static void main (String args[]) throws IOException {
Console c = System.console();
if (c == null) {
System.err.println("No console.");
System.exit(1);
}
}
}

Previous Topic:JDT Inline Method Refactoring
Next Topic:Create Java project programmatically
Goto Forum:
  


Current Time: Sun Dec 21 10:46:05 GMT 2014

Powered by FUDForum. Page generated in 0.01741 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software