title: maven with JDK11: javac: invalid flag: --release
body: <p>I'm trying to set up a simple maven project with java 11. As I want to keep JAVA_HOME to be version 8, I'm using <code>maven-toolchains-plugin</code> to make maven use jdk11 for this project.</p>
  
  <p>While maven successfully finds a matching toolchain for jdk-11.0.1, I keep getting " javac: invalid flag: --release". What am I doing wrong?</p>
  
  <p>Here are the plugin configurations:</p>
  
  <pre><code> &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.8.0&lt;/version&gt;
      &lt;configuration&gt;
        &lt;release&gt;11&lt;/release&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
    &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-toolchains-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.1&lt;/version&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;goals&gt;
            &lt;goal&gt;toolchain&lt;/goal&gt;
          &lt;/goals&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
      &lt;configuration&gt;
        &lt;toolchains&gt;
          &lt;jdk&gt;
            &lt;version&gt;11&lt;/version&gt;
          &lt;/jdk&gt;
        &lt;/toolchains&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  </code></pre>
  
  <p>The toolchain is defined as:</p>
  
  <pre><code> &lt;toolchain&gt;
     &lt;type&gt;jdk&lt;/type&gt;
     &lt;provides&gt;
       &lt;version&gt;11&lt;/version&gt;
       &lt;id&gt;JavaSE-1.11&lt;/id&gt;
     &lt;/provides&gt;
     &lt;configuration&gt;
       &lt;jdkHome&gt;C:\Program Files\Java\jdk-11.0.1\bin&lt;/jdkHome&gt;
     &lt;/configuration&gt;
  &lt;toolchain&gt;
  </code></pre>