Improve error message from shebang launcher for --enable-preview script

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 24
    • Component/s: tools
    • None
    • Cause Known
    • generic
    • generic

      shebang script:

      $ cat Hello
      #!/usr/bin/env java --enable-preview

      void main() {
         println("hello");
      }

      $ chmod 755 Hello

      $ ./Hello
      Error: Could not find or load main class ..Hello
      Caused by: java.lang.ClassNotFoundException: //Hello

      Per JEP 330

      "The --source option must also be used to specify the source version of the source code when the --enable-preview option is used."

      But, the error message above is misleading. The error message may mention about --source option requirement.

            Assignee:
            Unassigned
            Reporter:
            Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: