When I run echo "Maven is on versionmvn -v", the following error occurs:
Error: JAVA_HOME is not defined correctly. We cannot execute /usr/lib/jvm/java-8-oracle/bin/java Maven is on version
I tried different solutions explained in other threats, however none worked so far:
I set JAVA_HOME (/usr/lib/jvm/java-8-openjdk-amd64/jre) in the following places /etc/profile.d/jdk.sh, etc/enviroment, bashrc.
echo $JAVA_HOME gives:
/usr/lib/jvm/java-8-openjdk-amd64/jre
echo $PATH outputs:
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
So, I cannot figure out why Maven version checking points to inexisting folder /usr/lib/jvm/java-8-oracle/bin/java.