Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8361613

System.console() should only be available for interactive terminal

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • 26
    • core-libs
    • None
    • generic
    • generic

      In prior JDK releases, There are cases where `System.console()` may return a Console instance even when the JVM is not attached to a terminal. This may confuse users in case inputs are not coming from the keyboard, or outputs are not displayed on the display (such as redirected from/to file/pipe), especially for `readPassword` method. In JDK25, the default behavior has been modified to return null in case the stdin and/or stdout is redirected, but still there are cases if JLine based Console implementation is specified via the sytem property.

            naoto Naoto Sato
            naoto Naoto Sato
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: