Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7903809

Invalid source release N with --enable-preview

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • jtreg7.5
    • jtreg7.5
    • tools
    • None

    Description

      jtreg must not add "--enable-preview" and "--source N" to the list of javac arguments of the compile action when a lower JDK is the target

      Source: https://github.com/openjdk/jdk/blob/cec222e46065fc15db3f2eb241d3607d605ab580/test/langtools/tools/jnativescan/TestMissingSystemClass.java#L28
      ```
      error: invalid source release 20 with --enable-preview
        (preview language features are only supported for release 24)
      ```

      Source: https://github.com/openjdk/jdk/blob/beeffd4671649e5d8f9c96f0455ac90a82917234/test/langtools/tools/javac/classfiles/attributes/Synthetic/BridgeMethodsForLambdaTargetRelease14Test.java#L38
      ```
      error: invalid source release 14 with --enable-preview
        (preview language features are only supported for release 24)
      ```

      Attachments

        Issue Links

          Activity

            People

              cstein Christian Stein
              cstein Christian Stein
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: