How to install Maven on Mac OS X Mavericks (10.9)

來源:互聯網
上載者:User

標籤:maven   mac   

Step 1: Download Maven binaries from Maven Download Page. I was using Maven 3.0.5, so I downloaded apache-maven-3.0.5-bin.tar.gz.

Step 2: You can install Maven at any location but since it’s a one time process, I didn’t wanted it in my user directory. So I installed it in /usr/local directory. You might have to use sudo command to install in /usr/local directory if you are getting permission denied error.

$ cd /usr/local$ sudo mv /Users/chang/Desktop/apache-maven-3.3.3-bin.tar.gz ./$ sudo tar -xvf apache-maven-3.3.3-bin.tar.gz

Step 3: Now open the bash profile file and add following lines into it. Usually profile file names are .bash_profile or .profile, use whichever you have in your system. If you don’t have profile file, you will have to create one with vi command.

$ cd $HOME$ vi .bash_profile#Add below lines in the profileexport M2_HOME=/usr/local/apache-maven-3.3.3export PATH=$PATH:$M2_HOME/bin#save and quit$ source .bash_profile 

That’s it, maven is installed on your latest Mac OS X and you can verify it by issuing below command.

$ mvn --versionApache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00)Maven home: /usr/local/apache-maven-3.3.3Java version: 1.7.0_71, vendor: Oracle CorporationJava home: /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jreDefault locale: zh_CN, platform encoding: UTF-8OS name: "mac os x", version: "10.10.3", arch: "x86_64", family: "mac"

參考:http://www.journaldev.com/2348/how-to-install-maven-on-mac-os-x-mavericks-10-9

How to install Maven on Mac OS X Mavericks (10.9)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.