Monday, July 11, 2011

How to Set Environment Variables in Linux (Ubuntu)

In my case, I want to set JAVA_HOME, M2_HOME and M2 which are used by the application "Maven 2".

First, go to your default home directory.

Then, open your .profile file using a text editor like gedit and add the following lines at the end

JAVA_HOME="your jdk directory path"
M2_HOME="your maven directory path"
M2="$M2_HOME/bin"
export JAVA_HOME
export M2_HOME
export M2
export PATH=$M2:$PATH

No comments:

Post a Comment