Problem:
I am trying to install apache maven 3 in Ubuntu 12.04 lts. What I did was open the terminal then I typed the following commands
- Export M2_HOME =/usr/local/apache-maven/apache-maven-3.0.5 [Then pressed Enter]
- Export M2 = $ M2_HOME/bin [Then pressed Enter]
- Export PATH = $ M2: $ PATH [Then pressed Enter]
After that I typed
mvn --version
And it displayed all the necessary information but after closing the terminal, again I typed the commandmvn --version
The program 'mvn' can be found in the following packages: * maven * maven2Try sudo apt-get install <selected-page>
The solution is http://askubuntu.com/questions/310059/ubuntu-adding-path-environment-variables below
The problem is that the PATH is added to the environment,
$source /etc/environment
Then mvn -- vsersion
xx@xxx:/usr/local$ mvn --versionApache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T21:51:42+08:00)Maven home: /usr/local/apache-maven-3.2.2Java version: 1.7.0_55, vendor: Oracle CorporationJava home: /usr/lib/jvm/java-7-openjdk-amd64/jreDefault locale: en_US, platform encoding: UTF-8OS name: "linux", version: "3.13.0-29-generic", arch: "amd64", family: "unix"