title: Running Gradle with Java8 and compile Java13 with fork
body: <p>I want to run Gradle with the default system JRE, in my case Java8.</p>
  
  <p>And in the build I want to use a specific JDK 13 with the option.fork=true</p>
  
  <pre><code>compileJava {
      options.encoding = 'UTF-8'
      sourceCompatibility = 13
      targetCompatibility = 13
      options.compilerArgs &lt;&lt; "-parameters"
      options.compilerArgs &lt;&lt; "--release" &lt;&lt; "13"
      options.compilerArgs &lt;&lt; "--enable-preview"
      options.fork = true
      options.forkOptions.executable = "${projectDir}/tools/java/bin/javac.exe"
  }
  </code></pre>
  
  <p>When I start gradle with the JRE 8, this fails with message:</p>
  
  <pre><code>FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':compileJava'.
  &gt; Could not target platform: 'Java SE 13' using tool chain: 'JDK 8 (1.8)'.
  </code></pre>
  
  <p>But when I set the JAVA_HOME to the JDK 13, then it runs successfully.</p>
  
  <p>Is there a way I can make this run, with the Gradle started with JRE8 but using the JDK13 for the build?</p>
  
  <p>Frank</p>