X
xmx
I use jdk6 and Eclipse3.2
When I run the following codes in eclipse:
---------------code begins---------------------------------
public class Test {
public static void main(String[] args) {
System.console().readPassword();
}
}
---------------code ends------------------------------------
I get this:
--------------------------------
Exception in thread "main" java.lang.NullPointerException
at HelloWorld.main(HelloWorld.java:3)
--------------------------------
But it runs well in command line.
Who can tell me why?
Is this a bug of eclipse or jdk6?
Thanks very much!
When I run the following codes in eclipse:
---------------code begins---------------------------------
public class Test {
public static void main(String[] args) {
System.console().readPassword();
}
}
---------------code ends------------------------------------
I get this:
--------------------------------
Exception in thread "main" java.lang.NullPointerException
at HelloWorld.main(HelloWorld.java:3)
--------------------------------
But it runs well in command line.
Who can tell me why?
Is this a bug of eclipse or jdk6?
Thanks very much!