【玩轉Ubuntu】03. Ubuntu上配置Maven環境

來源:互聯網
上載者:User

1. 下載maven
maven:http://maven.apache.org/download.cgi
我下載的是:apache-maven-3.1.0-bin.tar.gz

2. 移動自己的存放目錄

bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/下載$ mv apache-maven-3.1.0-bin.tar.gz /home/bixiaopeng/soft/jarsbixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/下載$ cd /home/bixiaopeng/soft/jars


3. 解壓

bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/jars$ tar -zxvf apache-maven-3.1.0-bin.tar.gz#查看解壓後的結果bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/jars$ ls -al apache-maven-3.1.0/總用量 44drwxrwxr-x 6 bixiaopeng bixiaopeng 4096 8月 21 14:29 .drwxrwxr-x 3 bixiaopeng bixiaopeng 4096 8月 21 14:29 ..drwxrwxr-x 2 bixiaopeng bixiaopeng 4096 8月 21 14:29 bindrwxrwxr-x 2 bixiaopeng bixiaopeng 4096 8月 21 14:29 bootdrwxr-xr-x 3 bixiaopeng bixiaopeng 4096 6月 28 10:12 confdrwxr-xr-x 3 bixiaopeng bixiaopeng 4096 6月 28 10:12 lib-rw-r--r-- 1 bixiaopeng bixiaopeng 11358 6月 28 10:12 LICENSE.txt-rw-r--r-- 1 bixiaopeng bixiaopeng 1112 6月 28 10:12 NOTICE.txt-rw-r--r-- 1 bixiaopeng bixiaopeng 2513 6月 28 10:12 README.txt

4. 配置maven環境變數 

vim ~/.bashrc

#添加在檔案底部
export MAVEN_HOME=/home/bixiaopeng/soft/jars/apache-maven-3.1.0export PATH=${MAVEN_HOME}/bin:$PATH

5. 修攺完成後使其立即生效

bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/jars$ source ~/.bashrc

6. 查看一下版本

bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/jars$ cd ~bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~$ mvn -vApache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-28 10:15:32+0800)Maven home: /home/bixiaopeng/soft/jars/apache-maven-3.1.0Java version: 1.6.0_45, vendor: Sun Microsystems Inc.Java home: /home/bixiaopeng/soft/jvm/jdk/jreDefault locale: zh_CN, platform encoding: UTF-8OS name: "linux", version: "3.8.0-27-generic", 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.