I have downloaded the latest apache-maven3.zip file and extracted it to the folder:
/home/gaurav/Java/maven3
.
I don't know how to set the environmental variables for maven - such as PATH and M2_HOME.
I tried below things:
export M2_HOME=/home/gaurav/Java/maven3
export PATH= /home/gaurav/Java/maven3/bin:${PATH}
After setting that, I ran mvn --version
and it is running correctly.
But when next time I start my machine, and type $M2_HOME
, its not showing me the details of the path variables, neither mvn --version
is getting executed.
Please help me to resolve this problem of permanently setting environment variables in Ubuntu.