using --enable-preview as first argument gives Could not find or load main class

XMLWordPrintable

    • generic
    • generic
    • Verified

      A DESCRIPTION OF THE PROBLEM :
      position of --enable-preview on command line seem to matter where it should not .
      --enable-preview as the first argument results in java trying to load `--enable-preview` as a class.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      java —-enable-preview -classpath some.jar some.MyClass

      reports "Error: Could not find or load main class —-enable-preview"

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      it should report error "Could not find or load main class some.MyClass"

      which does happen if you do:
       java -classpath some.jar --enable-preview some.MyClass


      ---------- BEGIN SOURCE ----------
      none needed, source does not matter.
      ---------- END SOURCE ----------

      FREQUENCY : always


            Assignee:
            Anupam Dev
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: