Mvn command not found to create maven project on Linux

I am trying to build my maven project on linux and for that I do mvn clean install, but it says mvn: command was not found. I also checked my maven version and its correct version, how can I build it. Please tell us.

+3


source to share


1 answer


For Linux, you need the following in ~ / .bash_profile or ~ / .profile, you set these environment variables:

JAVA_HOME=...../jdk1.8.0_92
M2_HOME=...../apache-maven-3.3.9
PATH="${JAVA_HOME}/bin:${M2_HOME}/bin:${PATH}"

      



Obviously .... needs to be installed in the correct directory.

Make sure you start a new shell or source ~ / .bash_profile or ~ / .profile.

0


source







All Articles