简体   繁体   中英

gradle-6.9 detects old JAVA path even I have updated JAVA_HOME (react-native)

I was using java from this path C:\Program Files\Java\jdk-17 and I have used gradle-6.9 at that time. Later I have installed OpenJDK and now my JAVA_HOME is C:\Program Files\Eclipse Foundation\jdk-11.0.12.7-hotspot . But now if I run gradle using gradle-6.9 version I am getting this

$ ./gradle

FAILURE: Build failed with an exception.

  • What went wrong: The supplied javaHome seems to be invalid. I cannot find the java executable. Tr
    ied location: C:\Program Files\Java\jdk-17\bin\java.exe

  • 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

But If I am using any other gradle version for example even 6.9.1 as well everything works fine

eg: 6.9.1, 7.x

I have tried removing cache folder as well but no hope, please help

以前的 java 已卸载,但目录仍然存在C:\Program Files\Java\jdk-17删除它,现在可以正常工作

I uninstalled the old version of java , and made sure that directory doesnt exist anymore . Installed new version, updated the path variables , rebooted machine but still facing this issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM