Uploaded image for project: 'Maven Compiler Plugin'
  1. Maven Compiler Plugin
  2. MCOMPILER-270

Support release=8 on JDK 9

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 3.5.1
    • 3.6.0
    • None

    Description

      JDK 9 now supports the the follow argument:

      javac -release 7
      

      This replaced both `-source 7` and `-target 7`. And it prevents from using methods introduced in JDK 9 or JDK 8 when compiling for 7 with JDK 9. So `-release 8` basically better in every way than `-source 7 -target 7`.
      http://mail.openjdk.java.net/pipermail/jdk9-dev/2015-July/002414.html

      Support this in the maven-compiler plugin, something like:

              <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                  <release>7</release>
                </configuration>
              </plugin>
      

      When compiling with JDK 9, it should just do `javac -release 7`.

      When compiling with JDK 8 or lower, it should fallback to `javac -source 7 -target 7`, so it behaves exactly like:

              <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                  <source>7</source>
                  <target>7</target>
                </configuration>
              </plugin>
      

      Attachments

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              ge0ffrey Geoffrey De Smet
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: