Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on Ubuntu linux machine. When I open a terminal window and type :

mvn -v

I got the output:

Apache Maven 2.2.1 (rdebian-1)
Java version: 1.6.0_26
Java home: /usr/lib/jvm/java-6-sun-
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-33-generic" arch: "i386" Family: "unix"

As you saw above, my current maven version is 2.2.1 , I am wondering, how can I update my maven to verstion 3 ?

What I tried: I have downloaded maven v3.0.3 binary version, and add the /apache-maven-3.0.3/bin/ path in .bash_profile file, but when I use mvn -v command, it still shows version 2...

share|improve this question

migrated from Sep 21 '11 at 12:54

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

change the path on .bashrc instead, also remember to restart you terminal application after the changes

you need to add something like this, perhaps?

export PATH=$HOME/apache-maven-3.0.3/bin/:$PATH
share|improve this answer
Explanation: .bash_profile is only included for login shells, but not for shells in terminal emulators like xterm. That is why you very rarely need to change .bashrc. Additionally, remember to put /apache-maven-3.0.3/bin at the FRONT of the path. – thiton Sep 20 '11 at 12:26
Thanks, why add it in .bash_profile does not work but add in .bashrc works? – Leem Sep 20 '11 at 12:31
as @thiton explained, the gnome-terminal that you are probably using loads .bashrc during the application start-up, if you login to linux console directly (like when you do ctrl+alt+F6) then .bash_profile is what gets loaded as part of the login process. – ilcavero Sep 20 '11 at 12:35

You must log in to answer this question.