Java Cup
Inside Java

News and views from members of the Java team at Oracle

JLine is now the Default Console Provider - Quality Outreach Heads-up

The OpenJDK Quality Group promotes the testing of FOSS projects with OpenJDK early-access builds as a way to improve the overall quality of the release. This heads-up is part of a Quality Outreach update sent to the projects involved. To learn more about the program and how to join, please check the Quality Outreach wiki page.

JDK 21 & JDK 22: JLine is now the Default Console Provider

In JDK 22, System.console() has been changed to return a Console with enhanced editing features that improve the experience of programs that use the Console API. In addition, System.console() now returns a Console object when the standard streams are redirected or connected to a virtual terminal. Prior to JDK 22, System.console() instead returned null for these cases. This change may impact code that checks the return from System.console() to test if the JVM is connected to a terminal. If required, the -Djdk.console=java.base flag will restore the old behavior where the console is only returned when it is connected to a terminal. Starting JDK 22, one could also use the new Console.isTerminal() method to test if the console is connected to a terminal.

For additional information, please check JDK-8308591.

~