On my system (Win 10, JRE 1.8.0, Android Studio 3.1.2, Gradle 4.1) there is no
tools.jar in the JRE directory (C:Program FilesJavajre1.8.0_171).
However, I found it in C:Program FilesAndroidAndroid Studiojrelib and
tried setting JAVA_HOME=C:Program FilesAndroidAndroid Studiojre
That works (for me)!
on linux -> you need
1) to install openjdk :
sudo apt-get install openjdk-8-jdk
2) export jdk location :
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
On my system (Win 10, JRE 1.8.0, Android Studio 3.1.2, Gradle 4.1) there is no tools.jar in the JRE directory (C:Program FilesJavajre1.8.0_171).
However, I found it in C:Program FilesAndroidAndroid Studiojrelib and tried setting JAVA_HOME=C:Program FilesAndroidAndroid Studiojre
You should not alter gradle.properties manually. Try setting your
JAVA_HOME in ~/.zshrc to something like-
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
then relaunch a terminal session