I am new to Ubuntu and Maven. Recently I installed Maven in my system as user and the installation went perfectly, but I can't set path environment variable permanently. I also referred to the following questions but I couldn't solve my problem.
Maven environment variable not working on other terminal
How to permanently set environmental variables PATH and M2_HOME in ubuntu for maven3?
I can set m2_home
path in my system as user but when I check if the path is set with mvn -v
I get the following error:
Error: JAVA_HOME is not defined correctly. We cannot execute /usr/lib/jvm/jdk1.8.0/bin/java
When I restart the terminal I can't find the path of M2_home
. I don't have root access.
.bashrc
file. – mariaczi Jul 04 '18 at 13:46M2_HOME
,m2_home
andM2_home
are 3 different variables. Double check that – Eskander Bejaoui Jul 04 '18 at 16:51