If you run into this problem from the terminal in Android Studio, you should configure JAVA_HOME in your environment into javaJava 11, set the gradle jdkGradle JDK in PerferencesPreferences can't solve. I guess that running the gradleGradle from the terminal and running gradleGradle from idethe IDE are not the same process and they use different jdkJDK location.
Active reading [<https://en.wikipedia.org/wiki/Java_%28programming_language%29> <https://en.wikipedia.org/wiki/Gradle> <https://en.wikipedia.org/wiki/Java_Development_Kit> <https://en.wiktionary.org/wiki/preferences#Noun_2> <https://en.wikipedia.org/wiki/Integrated_development_environment>].
Peter Mortensen
- 31.4k
- 22
- 110
- 134