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

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

    XMLWordPrintable

Details

    • generic
    • generic
    • Verified

    Description

      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


      Attachments

        Activity

          People

            adev ANUPAM DEV
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: