2. Configuring your System Environment Variables
2. Configuring your System Environment Variables
Set the system environment variables following the instructions below.
- Open the Start menu, right-click Computer and select Properties.
- Click Advanced System Settings, located at the left side of the System window.
- In the System Properties window, click Environment Variables to display the Environment Variables window.
- Click New... to add a new System Environment variable.
- Add the System Environment variables and values shown in the table below:
Variable Name
Variable Value
JAVA_HOME
C:\Program Files\Java\jdk1.7.0_21
JAVA_OPTS
-Xmx1024m -XX:MaxPermSize=512m -Dsun.lang.ClassLoader.allowArraySyntax=true
MAVEN_HOME
C:\apache-maven-3.0.4
MAVEN_OPTS
-Xmx1024m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m -Dsun.lang.ClassLoader.allowArraySyntax=true -ea
Note: Java and Maven Home VariablesThe values you set for JAVA_HOME, MAVEN_HOME, and depend on where you installed Java and Maven.
- Select the Path system variable, and click Edit...
- Append the values below to the end of the Path variable value:
;%JAVA_HOME%\bin;%MAVEN_HOME%\bin;
Tip:
Linux Tip
To set the system variables on Linux, modify your .bash_profile in your home folder. An example of this is shown below:
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH JAVA_HOME=/home/USERNAME/tools/jdk1.7.0_21 export JAVA_HOME JAVA_OPTS='-Xmx1024m -XX:MaxPermSize=512m -Dsun.lang.ClassLoader.allowArraySyntax=true' export JAVA_OPTS MAVEN_HOME=/home/USERNAME/tools/apache-maven-3.0.4 export MAVEN_HOME MAVEN_OPTS='-Xmx1024m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m -Dsun.lang.ClassLoader.allowArraySyntax=true -ea' export MAVEN_OPTS PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin export PATH
Do not copy/paste the example above—this is just an example.