Android Studio Is Using This JDK Location ... Which Is Different To What Gradle Uses By Default
Answer : Update For macOS only happens on macOS Mojave 10.14.6 . On macOS Catalina 10.15.3 , you only need to set JAVA_HOME in your shell. This answer deals with macOS cases. It doesn't imply Linux or Windows solutions. TLDR On macOS , Android Studio doesn't receive your environment variables defined in your .bash_profile when launched from Finder.app . You must define your environment variables in launchctl : launchctl setenv JAVA_HOME /path/to/my/project/specific/jdk or, if you want to use your system-defined JDK: launchctl setenv JAVA_HOME `/usr/libexec/java_home` But this only works for the current session of your machine. Next, you have to create a ~/Library/LaunchAgents/environment.plist file: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label...