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 [email protected]:~ $ 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:

    • [email protected]:~$ brew install maven will install Maven 3.1 which might cause issues
    • [email protected]:~$ brew install maven30 will install Maven 3.0 which should be better
  • Using Macports: (I did not test this)
    • [email protected]:~$ sudo port install maven3 will Install Maven 3.0.5
    • [email protected]:~$ sudo port select –set maven maven3 selects that version of Maven
  • Installing by hand:
    • Download Maven from its homepage
    • Follow the installation instructions:
      1. 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.
      2. In a command terminal, add the M2_HOME environment variable, e.g. export M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1.
      3. Add the M2 environment variable, e.g. export M2=$M2_HOME/bin.
      4. 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.
      5. Add M2 environment variable to your path, e.g. export PATH=M2:PATH.
      6. Make sure that JAVA_HOME is set to the location of your JDK, e.g. export JAVA_HOME=(/usr/libexec/javahome?v1.8)andthatJAVA_HOME/bin is in your PATH environment variable (although that might not be necessary with the latest Mac OS X versions and the Oracle JDK).
      7. Run mvn –version to verify that it is correctly installed.
时间: 2024-10-05 05:06:58

Maven Install on Mac OS X的相关文章

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

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

install Mac OS on Vmware

本文将用详尽的图文介绍如何在虚拟机中安装运行Mac OS X,只要严格地按照本教程一步步操作,即使不了解苹果电脑的读者,也能顺利地安装并运行Mac OS X. 一.准备工作 VMWare 12 Pro百度云:http://pan.baidu.com/s/1hrSuPZe 密码:7qz3360云盘:https://yunpan.cn/c67BiTFmzxpVs 访问密码 21cc Unlocker补丁工具百度云:http://pan.baidu.com/s/1pLLBnf1 密码:pcuu360云

使用CocoaPods的pod install 遇到的错误,未解决(Xcode版本v6.4,Mac OS版本v10.10.4)

转载请标明出处:http://blog.csdn.net/android_ls/article/details/47059957 一.CocoaPods 是一款很好的依赖管理工具,其安装步骤大致如下: 1.首先确保开发环境中已经安装了 Ruby(一般安装了 XCode,Ruby 会被自动安装上) 建议使用淘宝提供的 Gem源,在终端执行下列命令: $ gem sources --remove https://rubygems.org/ $ gem sources -a http://ruby.t

Install Docker on Mac OS X(转)

Install Docker on Mac OS X You can install Docker using Boot2Docker to run docker commands at your command-line. Choose this installation if you are familiar with the command-line or plan to contribute to the Docker project on GitHub. Alternatively,

Mac OS X 10.10 Yosemite下安装java、jdk、mysql、maven、idea

Mac OS X Yosemite已经在2014年10月17日正式发布了. 作为一个java开发者,尝鲜第一时间安装了最新版本. 和之前的OS X系统还是有很多不同的.下面主要在java开发环境方面做一个笔记. 1.jdk安装 默认情况下,10.10系统同样没有安装JDK,也不会自动到Apple服务器下载jdk. 这两有两个选择,一是到oracle官网下载最新版(1.8.0_25)的jdk:二是下载苹果官方提供的10.9的1.6.0_65版本jdk, 1.6.0_65版本下载地址:http://

mac OS 安装maven遇到问题e45: 'readonly' option is set

1.下载 Maven, 并解压到某个目录.例如/Users/yintingting/apache-maven-3.3.9 2.打开Terminal,输入以下命令,设置Maven classpath vi ~/.bash_profile 3.添加下列两行代码,之后保存并退出Vi: export M2_HOME=/Users/yintingting/apache-maven-3.3.9(这里写你自己的maven文件路径) export PATH=$PATH:$M2_HOME/bin 4.然后按ESC

Install and set JAVA home on MAC OS with commandline

最近需要在MAC上做一些测试,由于测试机没有安装Java,只能自己安装,由于不能通过图形化界面访问测试机,只能通过命令行的形式来安装JAVA. 1. Download the jre/jdk install package from Oracle website,use hdiutil to mount the dmg file sh-3.2# hdiutil mount  jre-7u55-macosx-x64.dmgChecksumming Protective Master Boot Re

mac os 10.10 pod install errors

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -rubygems /Library/Ruby/Gems/2.0.0/gems/rake-0.9.6/bin/rake RUBYARCHDIR=/Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/xcodeproj-0.17.0 RUBYLIBDIR=/Library/Ruby/Gems/2

How to install BMW E-sys software on Windows XP & Mac OS X

It’s an instruction on how to setup BMW ENET cable software E-SYS on Windows XP & Mac OS X. Requirement: Laptop running Windows XP or higher (Mac OS X is capable, only if running a windows VM) 2GB RAM 3GB Free Hard Drive Space WiFi Connection at the