I have just installed gradle from the terminal
sudo apt-get install gradle
After finishing am trying to run the command
gradle -v
I get the following error
ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-7-oracle/jre/bin/java
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
When I run echo $JAVA_HOME
I get
/usr/lib/jvm/java-7-oracle/jre/bin/java
So that's the correct path I edited my bashrc file added the following lines
export JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre/bin/java
export JAVA_HOME
I still get the same error when I run gradle -v