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

JShell: locks forever when input is piped

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 9
    • 9
    • tools
    • It seems to me that this issue is on Unix env.
      I've confirmed this on my Ubuntu.

      I think this is not shown on Windows, please see my comment.

    • b141
    • generic
    • linux_ubuntu
    • Not verified

    Description

      Consider following:
      echo "System.out.println()" | jshell

      jshell should exit as soon as printing empty line but it locks forever.


      Another case,
      java Main | jshell

      Main is,

      public class Main {
          public static void main(String[] args) throws Exception {
              for (int i = 0; i < 10; i++) {
                  Thread.sleep(1000);
                  System.out.println("System.out.println(" + i + ")");
              }
          }
      }

      jshell should exit 10 sec. later after printing from 0 to 9.

      Attachments

        Activity

          People

            jlahoda Jan Lahoda
            shinyafox Shinya Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: