Linux – How to setup path for maven

linuxmavenmaven-2

I am trying to setup a path variable for my maven installation. The system information is like:

 [user1@machine1]~% whereis maven
 maven: /etc/maven
 [user1@machine1]~% cd /etc/maven
 [user1@machine1]/etc/maven% ls
 maven2-depmap.xml

should I setup path like

export MAVEN_HOME=/home/user1/etc/maven/

But based on ls command, it seems that there does not exist the binary maven file except maven2-depmap.xml under /etc/maven/

Best Solution

The command is named mvn. I have no idea what /etc/maven would be, it seems like some crazed Linux distro person's idea of a joke; it certainly isn't a maven home.

Please download an ordinary tarball of maven from maven.apache.org, and unpack it in /opt. You don't have to set MAVEN_HOME, just put /opt/apache-maven-whatever/bin in your path.