O'Reilly logo

Apache Maven Cookbook by Raghuram Bharathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Installing Maven on Mac OS X

Let us look at the steps to install Maven on Mac OS X. This applies to the latest version of Mac OS X, namely Yosemite.

Earlier, Apple provided Java for Mac, but stopped doing so from Java 7 onwards. Apple Java is not available on recent versions of Mac OS X.

Getting ready

Let us check if the Java environment is available on your Mac:

  1. Open the terminal and run the following command:
    /usr/libexec/java_home -v 1.7
    
  2. See if you get an output similar to the following:
    /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home
    
  3. Run the following command to check if you have Java 8:
    /usr/libexec/java_home -v 1.8
    
  4. This should give the following output if Java exists:
    /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required