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

JShell does not handle -source 8 properly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b06

      Description

      Running JShell with -source 8 (-C-source -C8), only the first snippet is evaluated:
      ---
      $ jshell -C-source -C8
      | Welcome to JShell -- Version 17-internal
      | For an introduction type: /help intro

      jshell> 1+1
      $1 ==> 2

      jshell> 1+2
      | Error:
      | cannot find symbol
      | symbol: class
      | 1+2
      | ^
      | Error:
      | static import only from classes and interfaces
      | 1+2
      | ^

      ---

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jlahoda Jan Lahoda
              Reporter:
              jlahoda Jan Lahoda
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: