How should I set up Maven 3 properly?
My environment:
My .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$JAVA_HOME/bin:$M2_HOME/bin
export PATH
JAVA_HOME=/usr/java/jdk1.7.0_02
export JAVA_HOME
M2_HOME=/home/ic/apache-maven-3.0.4
export M2_HOME
When I type java -version, the system shows me
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode, sharing)
But when I type mvn -v, it shows me:
bash: mvn: command not found...
What should I do, in order to set up Maven 3 properly?
Thanks in advance!
Ordering is important!
JAVA_HOME=/usr/java/jdk1.7.0_02
export JAVA_HOME
M2_HOME=/home/ic/apache-maven-3.0.4
export M2_HOME
# after the variables are assigned!!!
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$JAVA_HOME/bin:$M2_HOME/bin
export PATH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With