Derry Spann | {hostname}

Java Maven installation steps

Maven is a package manager for creating and organizing Java apps.

Step 1. Download Maven from website

http://maven.apache.org/download.cgi

Step 2. Set System variables to directory path of downloaded folder

export M2_HOME = /PATH/TO/YOUR/MAVEN/DIRECTORY
export PATH=$PATH:/PATH/TO/YOUR/MAVEN/DIRECTORY

Step 3. Verify Maven. Open terminal and run

mvn --version

If successful you should see the version of maven displaying in terminal window.

Note at this point the mvn is only available for open terminal session

To extend mvn for future use, proceed with the following bash commands

Step 4. Open Bash_profile and insert the following line

export M2_HOME = /PATH/TO/YOUR/MAVEN/DIRECTORY
export PATH=$PATH:/PATH/TO/YOUR/MAVEN/DIRECTORY/bin

update: Use Homebrew to install java and maven