I have set my JAVA_HOME
to /usr/lib/jvm/java-7-oracle
, which contains a valid JVM, but gradle insists on using /usr/lib/jvm/default-java
and complains about JAVA_HOME
:
$ echo $JAVA_HOME
/usr/lib/jvm/java-7-oracle
$ ls $JAVA_HOME
bin COPYRIGHT db include jre lib LICENSE man README.html release src.zip THIRDPARTYLICENSEREADME-JAVAFX.txt THIRDPARTYLICENSEREADME.txt
$ gradle assemble
ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/default-java
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
How can I fix this and have gradle use my valid JAVA_HOME
?
Note: My JAVA_HOME
is set by ~/.bashrc
using export JAVA_HOME="/usr/lib/jvm/java-7-oracle"