Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » System.console() missing (Eclipse and Java on Ubuntu 20.04)
System.console() missing [message #1841238] Fri, 07 May 2021 12:39 Go to next message
Andjelko Basic is currently offline Andjelko BasicFriend
Messages: 3
Registered: August 2016
Junior Member
Hello,
I am using Eclipse v. 2020-12 (4.18.0) on Ubuntu 20.04 to teach myself Java. It works fine except that System.console() returns null, meaning that no Console is available. When I ask Ubuntu whether Java is installed (terminal query: java -version), it says that it is not. Does this mean that Eclipse has its own Java which is not available outside of it? And do I have to install an Eclipse-independent Java, just so that Console can be made available to Eclipse.
Thanks.
Re: System.console() missing [message #1841251 is a reply to message #1841238] Fri, 07 May 2021 20:44 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Why are you calling "System.console()"? What do you need it for?
Re: System.console() missing [message #1841317 is a reply to message #1841251] Wed, 12 May 2021 06:02 Go to previous messageGo to next message
Andjelko Basic is currently offline Andjelko BasicFriend
Messages: 3
Registered: August 2016
Junior Member
Just trying to learn different ways of I/O, as described in a text. Apparently console is one of them.
Re: System.console() missing [message #1842111 is a reply to message #1841317] Wed, 09 June 2021 13:11 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Java has problems accessing the console, when it itself was not launched from a console (like it is the case when running programs within Eclipse). The core of this issue is within the system libraries, not Eclipse, but I vaguely recall some attempts to hack into the system libraries to work around that limitations. Not sure if any progress has been made.

TL;DR: if you want to learn about System.console() run your programs from a system console.
Re: System.console() missing [message #1842839 is a reply to message #1842111] Fri, 02 July 2021 12:35 Go to previous message
Steven Tillson is currently offline Steven TillsonFriend
Messages: 5
Registered: June 2021
Junior Member
Why are you calling "System.console()"? Please show your entire code.
Previous Topic:Add buttons on a TreeViewer
Next Topic:Eclipse won't compile project on Google Drive
Goto Forum:
  


Current Time: Thu Apr 25 23:36:10 GMT 2024

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

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

Back to the top