CentOS安裝maven3.2.2(Linux系列適用)

來源:互聯網
上載者:User

標籤:style   blog   http   java   color   os   

首先,下載最新的maven3.2.2,地址:http://mirrors.cnnic.cn/apache/maven/maven-3/3.2.2/binaries/apache-maven-3.2.2-bin.tar.gz

[[email protected] ~]$ wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.2.2/binaries/apache-maven-3.2.2-bin.tar.gz...................省略..........................................省略.......................98% [=========================================================================================> ] 6,865,739   30.6K/s eta(英國中部時
99% [=========================================================================================> ] 6,883,491 29.7K/s eta(英國中部時
99% [=========================================================================================> ] 6,901,307 29.2K/s eta(英國中部時
99% [=========================================================================================> ] 6,912,251 30.7K/s eta(英國中部時
99% [=========================================================================================> ] 6,917,723 28.9K/s eta(英國中部時
99% [=========================================================================================> ] 6,930,035 28.4K/s eta(英國中部時
100%[==========================================================================================>] 6,940,967 29.4K/s in 4m 57s
2014-07-13 09:31:51 (22.9 KB/s) - 已儲存 “apache-maven-3.2.2-bin.tar.gz” [6940967/6940967]

其次,tar解壓apache-maven-3.2.2-bin.tar.gz

[[email protected] ~]$ tar -zxvf apache-maven-3.2.2-bin.tar.gz

配置環境變數:

[[email protected] ~]$vi ~/.bashrc # .bashrc# Source global definitionsif [ -f /etc/bashrc ]; then        . /etc/bashrcfi# User specific aliases and functionsexport MAVEN_HOME=/home/richard/apache-maven-3.2.2export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/binexport PATH

是環境變數生效:

[[email protected] ~]$ source ~/.bashrc 

最後,檢驗配置是否正確

[[email protected] richard]$ mvn -vApache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T21:51:42+08:00)Maven home: /home/richard/apache-maven-3.2.2Java version: 1.6.0_30, vendor: Sun Microsystems Inc.Java home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jreDefault locale: zh_CN, platform encoding: UTF-8OS name: "linux", version: "2.6.32-431.20.3.el6.x86_64", arch: "amd64", family: "unix"

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.