Java: Maven Environment Variables on OS X

Mac OS X comes with Apache Maven preinstalled. However, you're still going to need to set some environment variables to get up and running.

Verify that maven installed in /usr/share/maven:

    ls /usr/share/maven

Add the following line to your ~/.profile

    # Set the M2_HOME environment variable
    export M2_HOME=/usr/share/maven

    # Put maven on your path
    export PATH=$M2_HOME/bin:$PATH

This won't take effect until you either reboot or open a new terminal window. You can reload the file in the current terminal window with the following command:

    source ~/.profile

PrintView Printer Friendly Version

EmailEmail Article to Friend

References (1)

References allow you to track sources for this article, as well as articles that were written in response to this article.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
« Java: Embedding Spring Batch Admin Into An Existing Application | Main | Solving a Mobile PDF Problem »