title: Flutter error Kotlin could not find the required JDK tools
body: <p>I first created a new flutter project.</p>
  <p>But I got this error:</p>
  <pre><code>* What went wrong:
  Execution failed for task ':app:compileDebugKotlin'.
  &gt; Kotlin could not find the required JDK tools in the Java installation 'C:\Program Files\Java\jre1.8.0_261' used by Gradle. Make sure Gradle is running on a JDK, not JRE.
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 33s
  Exception: Gradle task assembleDebug failed with exit code 1
  </code></pre>
  <p>I also tried this method, but it didn't work.</p>
  <p><a href="https://i.stack.imgur.com/iHvx5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/iHvx5.png" alt="enter image description here" /></a></p>