I installed java and set path to environment and when I execute echo $JAVA_HOME I get the following output:
/usr/lib/jvm/java-7-oracle/jre/bin/j
You might get this error due to couple of reasons. To fix this quickly please follow below steps,
First find the java location. To get a list of your installed Java platforms, run the following command from the terminal:
$ sudo update-alternatives --config java
Now set JAVA_HOME and PATH,
$ export JAVA_HOME=
$ export PATH=$JAVA_HOME/jre/bin:$PATH
Create the symlink
$ sudo ln -s /jre
When we take your case as a example :
$ sudo ln -s /usr/lib/jvm/java-7-oracle/jre /usr/lib/jvm/java-7-oracle/jre/bin/java
Above command will create the symlink location where the system is trying to find in your issue.
Finally do the
$ mvn --version