LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Setting PATH and other variables (https://www.linuxquestions.org/questions/ubuntu-63/setting-path-and-other-variables-356668/)

durrantj 08-24-2005 08:09 PM

Setting PATH and other variables
 
I want to add to my PATH and have added the following lines

JAVA_HOME=/usr/java/jdk1.5.0_04
ANT_HOME=/apache-ant-1.6.5
PATH=${PATH}:${ANT_HOME}/bin
PATH=${PATH}:${JAVA_HOME}/bin

export $JAVA_HOME
export $ANT_HOME
export $PATH

first to .bash_profile and then when I couldn't get that to work I add the same lines to etc/profile

After adding the files I open a new terminal session - echo $PATH shows old PATH, so I logged out and back in and got the same results so I rebooted and logged in again. When I edit the files again, the changes are there but still the PATH is the same old stuff. When I do the commands just in a terminal window they work fine.

What am I doing wrong?

carl.waldbieser 08-24-2005 10:26 PM

Re: Setting PATH and other variables
 
Quote:

Originally posted by durrantj
I want to add to my PATH and have added the following lines

JAVA_HOME=/usr/java/jdk1.5.0_04
ANT_HOME=/apache-ant-1.6.5
PATH=${PATH}:${ANT_HOME}/bin
PATH=${PATH}:${JAVA_HOME}/bin

export $JAVA_HOME
export $ANT_HOME
export $PATH

first to .bash_profile and then when I couldn't get that to work I add the same lines to etc/profile

After adding the files I open a new terminal session - echo $PATH shows old PATH, so I logged out and back in and got the same results so I rebooted and logged in again. When I edit the files again, the changes are there but still the PATH is the same old stuff. When I do the commands just in a terminal window they work fine.

What am I doing wrong?

I think maybe you want to put them in your ~/.bashrc file. That file gets sourced every time you start a shell. ~/.bash_profile only gets sourced on login.

durrantj 08-25-2005 07:44 PM

That did it. Thanks.


All times are GMT -5. The time now is 11:55 PM.