In prior JDK releases, `System.console()` could return a `Console` instance even when the JVM was not attached to an interactive terminal. This could lead to confusion, particularly when input was not from a keyboard or output was redirected, such as to or from a file or pipe, especially when using methods like `readPassword()`. Starting with JDK 25, the default behavior has changed: `System.console()` now returns `null` if standard input and/or output is redirected. However, if a JLine-based Console implementation is explicitly specified via the system property `-Djdk.console=jdk.internal.le`, the previous behavior may still occur.
- csr for
-
JDK-8361911 System.console() should only be available for interactive terminal
-
- Draft
-
- relates to
-
JDK-8361972 Clarify the condition of System.console() about standard input/output
-
- In Progress
-
-
JDK-8354469 Keytool exposes the password in plain text when command is piped using | grep
-
- In Progress
-
- links to
-
Review(master) openjdk/jdk/26273