Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.console() returns null from Eclipse but fine with Command Prompt

Tags:

java

console

When I use System.console from Eclipse Helios, it always returns null.

However, when I use it directly from command line (i.e. compiling and executing a java source code manually from command prompt), I do get a Console object.

To know, why this happens I checked this link. According to it, when I run my Java code from Eclipse, a background job scheduler must be starting my JVM. What does this mean?

And how differently is my JVM started when I start it from command line?

I also checked this link. Here McDowell says that cmd.exe is a console device. So then I am again confused that exactly is a console device?

like image 391
whitehat Avatar asked Jan 23 '12 10:01

whitehat


1 Answers

Because it is a bug #122429 of eclipse

like image 186
thiagoh Avatar answered Sep 20 '22 01:09

thiagoh