Installation Environment
Operating system: Ubuntu 14.04.1 Server AMD64
Installing the JDK
Before you install MAVEN, you must ensure that you have installed the JDK.
Please refer to the article "Installing JDK in Ubuntu" for the method of installing the JDK.
Download maven
wget http://apache.fayea.com/apache-mirror/maven/maven-3/3.2.3/binaries/ Apache-maven-3.2.3-bin.tar.gz
Extract
tar -xzf apache-maven-3.2. 3-bin. tar. gz
Setting environment variables
Environment variables are divided into user variables and system variables.
User Variable profile: ~/.BASHRC (hidden files in the current user's home directory, can be found through ' ls-a ')
System environment configuration file:/etc/profile
As with the configuration of user variables and system variables, this article takes the example of configuring user variables.
Edit the configuration file. BASHRC:
VI . BASHRC
Append at end of file:
# set Maven environmentexport m2_home=/home/hadoop/apache-maven-3.2. 3 export PATH= $M 2_home/bin: $PATH
Make environment variables effective
source. BASHRC
Validation
Verify that MAVEN is installed successfully.
$ MVN--Versionapache Maven3.2.3(33F8C3E1027C3DDDE99D3CDEBAD2656A31E8FDF4; the- ,-12t04: -:Ten+ ,:xx) Maven Home:/home/hadoop/apache-maven-3.2.3Java Version:1.7. 0_67, Vendor:oracle Corporationjava home:/home/hadoop/jdk1.7.0_67/Jredefault Locale:en_us, platform Encoding:utf-8OS Name:"Linux", Version:"3.13.0-32-generic", Arch:"AMD64", Family:"Unix"
Install maven in Ubuntu