I am trying to run maven on Ubuntu. Every time I run something like mvn -v
I get:
"The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE".
The thing is that I have set JAVA_HOME correctly.
In /etc/environment: JAVA_HOME="/usr/lib/jvm/java-8-oracle"
.
Also, if I try echo $JAVA_HOME
it returns "/usr/lib/jvm/java-8-oracle", which is correct.
Am I doing something wrong?