Configure Environment Variables
Configure Environment Variables For Linux Users Add the following lines to your ~/.bash_profile. Ensure you change the [username] to your actual username, and that the Maven directory is the actual directory name. The version number may be different than the one listed below. export M2_HOME=/home/[username]/apache-maven-2.2.1 export M2=$M2_HOME/bin export PATH=$M2:$PATH By including M2 at the beginning of your path, the Maven version you just installed will be the default version used. You may also want to set the path of your JAVA_HOME environment variable to the location of the JDK on your system. For Windows Users Add the M2_HOME, M2, and JAVA_HOME environment variables. Press Start+Pause|Break. The System Properties dialog box is displayed. Click the Advanced tab, then click the Environment Variables button. Under System Variables, select Path. Click Edit, and append the two Maven paths using a semi-colon to separate each entry. Quotation marks are not required around paths. Add the variable M2_HOME and set the path to C:Program FilesApache Software Foundationapache-maven-2.2.1. Add the variable M2 and set the value to %M2_HOME%in. In the same dialog, create the JAVA_HOME environment variable: Add the variable %JAVA_HOME% and set the value to the location of your JDK. For example C:Program FilesJavajdk1.6.0_02. In the same dialog, update or create the Path environment variable: Add the variable %M2% to allow Maven to be executed from the command-line. Add the variable %JAVA_HOME%in to set the path to the correct Java installation. Click OK until the System Properties dialog box closes. Implement changes to .bash_profile For Linux Users Only To update the changes made to the .bash_profile in the current terminal session, source your .bash_profile. [localhost]$ source ~/.bash_profile Update gnome-terminal profile For Linux Users Only Update the terminal profile to ensure that subsequent iterations of gnome-terminal (or Konsole terminal) read the new environment variables. Click Edit → Profiles Select Default, and click the Edit button. In the Editing Profile dialog, click the Title and Command tab. Select the Run command as login shell check box. Close all open Terminal dialog boxes.