Gradle does not recognize the JAVA_HOME I have set Gradle does not recognize the JAVA_HOME I have set bash bash

Gradle does not recognize the JAVA_HOME I have set


it is quite common issue. Just go to your gradle home directory and bin, for example:

/home/user/gradle-2.0/bin

and there you should have gradle script, I am on a Windows machine now so I have gradle.bat, probably you will have gradle.sh or something like this. In that file, find the line:

set JAVA_HOME=%JAVA_HOME:"=%

or as I can see you are on linux so there will be "export" and change it to your java home directory for example:

export JAVA_HOME=/usr/lib/jvm/java-7-oracle


If on windows, also make changes to JAVA_EXE and add your path

    set JAVA_EXE=C:\yourpath\bin\java.exe