Maven Install on Mac OS X
Disclaimer: Here is a complete answer taking the last version of OS X (10.9 AKA Mavericks) into account. I am aware that everything I compiled in this answer is already present in the page, but having it clearly in one answer makes it a lot clearer.
First of all, with previous versions of OS X, Maven is installed by default. If Java is missing running you@host:~ $ java in a terminal will prompt you for the Java installation.
With Mac OS X 10.9 (Mavericks), Maven is not installed by default anymore. Different options are then possible:
Using Homebrew:
- you@host:~$ brew install maven will install Maven 3.1 which might cause issues
- you@host:~$ brew install maven30 will install Maven 3.0 which should be better
Using Macports: (I did not test this)
- you@host:~$ sudo port install maven3 will Install Maven 3.0.5
- you@host:~$ sudo port select –set maven maven3 selects that version of Maven
- Installing by hand:
- Download Maven from its homepage
- Follow the installation instructions:
- Extract the distribution archive, i.e. apache-maven-3.1.1-bin.tar.gz to the directory you wish to install Maven 3.1.1. These instructions assume you chose /usr/local/apache-maven. The subdirectory apache-maven-3.1.1 will be created from the archive.
- In a command terminal, add the M2_HOME environment variable, e.g. export M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1.
- Add the M2 environment variable, e.g. export M2=$M2_HOME/bin.
- Optional: Add the MAVEN_OPTS environment variable to specify JVM properties, e.g. export MAVEN_OPTS=”-Xms256m -Xmx512m”. This environment variable can be used to supply extra options to Maven.
- Add M2 environment variable to your path, e.g. export PATH=
M2: M2:PATH. - Make sure that JAVA_HOME is set to the location of your JDK, e.g. export JAVA_HOME=
(/usr/libexec/javahome−v1.8)andthat - Run mvn –version to verify that it is correctly installed.
相關文章
- How to install Maven on Mac OS X Mavericks (10.9)MavenMac
- Mac OS install treeMac
- Mac OS XMac
- How to install Maven on Mac OSXMavenMac
- Mac OS 配置Maven步驟MacMaven
- Install netCDF under mac osMac
- Vmware玩mac os x分享Mac
- [Mac OS X] 如何在終端檢視 Mac OS 版本資訊Mac
- Mac OS X 清除DNS快取MacDNS快取
- Mac OS X下如何使用OpenGLMac
- Mac OS X 背後的故事Mac
- MAC OS X下建立iso檔案Mac
- Mac OS X 下搭建thrift環境Mac
- mac os x 啟用apache 和 phpMacApachePHP
- Mac OS X 上用 otool 代替 lddMac
- Mac OS X常用軟體介紹Mac
- Windows下虛擬機器安裝Mac OS X ----- VM12安裝Mac OS X 10.11Windows虛擬機Mac
- Mac OS X中MacPorts安裝和使用Mac
- MAC OS X系統目錄結構Mac
- 提高 Mac OS X 速度的 52 個方法Mac
- 在Mac OS X中配置Apache + PHP + MySQLMacApachePHPMySql
- Mac OS X is not supported with software virtualization解決方法Mac
- Mac OS X 10.2 快速關機(轉)Mac
- Mac OS X 10.2 的按鍵(轉)Mac
- Mac OS X下實現矩形部分圓角Mac
- Hammerspoon for Mac - OS X桌面自動化神器Mac
- Mac OS X 顯示和隱藏檔案Mac
- 如何修復Mac OS X和bootcamp分割槽Macboot
- Mac OS X 驚現最危險木馬Mac
- mac OS X下配置jdk環境變數MacJDK變數
- Mac OS X 10.9.3 Beta 8升級教程Mac
- Mac OS X 10.2 列印點點通(轉)Mac
- mac os x EnvironmentError: mysql_config not foundMacErrorMySql
- 在Mac OS X中配置Apache+PHP+MySQLMacApachePHPMySql
- Mac OS X 上的PHP開發環境 vimMacPHP開發環境
- Mac(OS X)中Git安裝與GitHub基本使用MacGithub
- 第一個Mac OS X專案(純程式碼)Mac
- Mac OS X 系統的環境變數配置Mac變數