| Author |
Problems to use Console object on Java 6
|
Carlos Renato Domingos da Silva
Greenhorn
Joined: Dec 03, 2011
Posts: 4
|
|
Hi , I am using jdk1.6.0_27 and I am with problems on Console Object.
I am also using eclipse Helios Service Release 1 ( 20100917-0705 ).
This code below prints null. Somebody knows why?
import java.io.Console;
public class ConsoleTest {
public static void main( String[] args) {
Console console = System.console();
System.out.println("Console is " + console);
}
}
This code prints in my console: "Console is null"
What 's the problem?
|
 |
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
|
|
Carlos Renato Domingos da Silva wrote:What 's the problem?
Eclipse is the problem
|
Joanne
|
 |
Jeffrey Tian
Ranch Hand
Joined: Jun 02, 2010
Posts: 34
|
|
|
If you run it in command line, you'll get what you want.
|
 |
 |
|
|
subject: Problems to use Console object on Java 6
|
|
|