LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-24-2005, 08:09 PM   #1
durrantj
LQ Newbie
 
Registered: May 2005
Location: Utah
Distribution: Ubuntu
Posts: 19

Rep: Reputation: 0
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?
 
Old 08-24-2005, 10:26 PM   #2
carl.waldbieser
Member
 
Registered: Jun 2005
Location: Pennsylvania
Distribution: Kubuntu
Posts: 197

Rep: Reputation: 32
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.
 
Old 08-25-2005, 07:44 PM   #3
durrantj
LQ Newbie
 
Registered: May 2005
Location: Utah
Distribution: Ubuntu
Posts: 19

Original Poster
Rep: Reputation: 0
That did it. Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extra path variables? mjm461 Linux - General 1 09-15-2005 02:21 PM
adding $PATH variables karupt Linux - Newbie 5 03-07-2004 06:27 PM
can save new $PATH variables slinkysteve Linux - Newbie 1 10-29-2003 10:30 AM
removing path variables globally Nevetsmik103081 Linux - General 1 07-05-2003 01:17 PM
rh7.1 environment variables (eg path) dave_lane Linux - Newbie 1 09-20-2001 08:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 10:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration