Installation environment operating system: Ubuntu14.04.1serveramd64 install jdk before installing maven, you must ensure that jdk has been installed. For how to install jdk, see install JDK in Ubuntu14.04.1 at http://www.linuxidc.com/linux/2015-03/114618.htm. Download the mavenwgethttp: // apache.fayea.com installation environment
Operating System: Ubuntu 14.04.1 server amd64
Install jdk
Before installing maven, make sure that jdk has been installed.
For how to install jdk, see install JDK in Ubuntu 14.04.1 at http://www.linuxidc.com/linux/2015-03/114618.htm.
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
Set Environment Variables
Environment variables include user variables and system variables.
User variable configuration file :~ /. Bashrc (the hidden files in the current user's home directory can be viewed through 'LS-)
System Environment configuration file:/etc/profile
User variables are configured in the same way as system variables. This document uses user variables as an example.
Edit the configuration file. bashrc:
vi .bashrc
Append at the end of the file:
# set maven environmentexport M2_HOME=/home/Hadoop/apache-maven-3.2.3export PATH=$M2_HOME/bin:$PATH
Make environment variables take effect
source .bashrc
Verify
Verify that maven is successfully installed.
$ mvn --versionApache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T04:58:10+08:00)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"
Maven authoritative guide _ Chinese full clear PDF http://www.linuxidc.com/Linux/2014-06/103690.htm
Maven 3.1.0 release, http://www.linuxidc.com/Linux/2013-07/87403.htm of Project Build tools
Install Maven http://www.linuxidc.com/Linux/2013-05/84489.htm in Linux
Maven3.0 configuration and simple use http://www.linuxidc.com/Linux/2013-04/82939.htm
Build sun-jdk and Maven2 http://www.linuxidc.com/Linux/2012-12/76531.htm in Ubuntu
Maven getting started http://www.linuxidc.com/Linux/2012-11/74354.htm
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-03/114619.htm