Please tell me how to set environment variables

JAVA_HOME
MAVEN_HOME
TOMCAT_HOME
PATH

I installed Java via terminal apt-get command, Tomcat and Eclipse by downloading tar.gz files and extracting them. Maven also by terminal and by getting plugin to eclipse too.

Please tell me a answer step by step. I'm beginner to Ubuntu.

link|improve this question
feedback

migrated from stackoverflow.com May 19 '11 at 23:01

This question came from our site for professional and enthusiast programmers.

2 Answers

Go to a terminal and type :

export JAVA_HOME=/usr/lib/jvm/java-6-sun

and consequently for the others

Don't forget these values will be only available in your current terminal session. You'll have to add these to a persistent environnement file like ~/.bashrc or ~/.zshrc to keep them among a terminal session restart

To check for existing variables, type env

link|improve this answer
thanks dear friend.now it solved.. – djPriyan May 19 '11 at 14:35
feedback

It's not really clear whether you want to set from a program or what, but, in a bash shell, the syntax is: export JAVA_HOME=/path/to/JDK

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.