title: gradle-6.9 detects old JAVA path even I have updated JAVA_HOME (react-native)
body: <p>I was using java from this path <code>C:\Program Files\Java\jdk-17</code> and I have used gradle-6.9 at that time. Later I have installed OpenJDK and now my JAVA_HOME is <code>C:\Program Files\Eclipse Foundation\jdk-11.0.12.7-hotspot</code>. But now if I run gradle using gradle-6.9 version I am getting this</p>
  <blockquote>
  <p>$ ./gradle</p>
  <p>FAILURE: Build failed with an exception.</p>
  <ul>
  <li><p>What went wrong: The supplied javaHome seems to be invalid. I cannot find the java executable. Tr<br />
  ied location: C:\Program Files\Java\jdk-17\bin\java.exe</p>
  </li>
  <li><p>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.</p>
  </li>
  <li><p>Get more help at <a href="https://help.gradle.org" rel="noreferrer">https://help.gradle.org</a></p>
  </li>
  </ul>
  </blockquote>
  <p>But If I am using any other gradle version for example even 6.9.1 as well everything works fine</p>
  <p>eg: 6.9.1, 7.x</p>
  <p>I have tried removing cache folder as well but no hope, please help</p>