Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-09-2003, 09:18 AM
|
#1
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Rep: 
|
Help setting $PATH variable
Ok, I've just downloaded and installed the Java 2 SDK and did 'export PATH=$PATH:/usr/local/java' (without the quotes of course). The problem is that whenever I close the term, it unsets and goes back to the default. Any ideas? Thanx.
|
|
|
08-09-2003, 09:30 AM
|
#2
|
Member
Registered: Aug 2003
Location: .bh
Distribution: Gentoo
Posts: 188
Rep:
|
add it to the user's .bashrc and/or .bash_profile for a single user
or to /etc/profile for everybody
|
|
|
08-09-2003, 09:30 AM
|
#3
|
Senior Member
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403
Rep:
|
You can append to the PATH variable by adding to your new path to the .bash_profile
.bash_profile is the login script for a user and it is located in the HOME directory of each user.
OR
You can set system wide variables and startup programs by adding to the /etc/profile
----
I posted at the same time as jalal,
mental note... next time... type faster. 
Last edited by Mathieu; 08-09-2003 at 09:37 AM.
|
|
|
08-09-2003, 09:47 AM
|
#4
|
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263
Rep:
|
dont you mean /usr/local/java/bin, not /usr/local/java?
|
|
|
08-09-2003, 09:50 AM
|
#5
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Original Poster
Rep: 
|
Neither .bashrc or .bash_profile exist in my /home/nick. I edited /etc/profile:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/usr/local/j2sdk1.4.2/bin"
When I do 'echo $PATH', the new directory isn't there, so I also get 'java: command not found' :/.
|
|
|
08-09-2003, 09:54 AM
|
#6
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Original Poster
Rep: 
|
Quote:
Originally posted by kev82
dont you mean /usr/local/java/bin, not /usr/local/java?
|
No, actually I meant /usr/local/j2sdk1.4.2/bin  .
|
|
|
08-09-2003, 09:56 AM
|
#7
|
Member
Registered: Aug 2003
Location: .bh
Distribution: Gentoo
Posts: 188
Rep:
|
they don't have to. just create a .bashrc/.bash_profile in your ~ dir and restart the term (if under X).
for /etc/profile, it didn't do anything because it was read when the system was booted. it will take effect next time you boot (hopefully  )
|
|
|
08-09-2003, 10:10 AM
|
#8
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Original Poster
Rep: 
|
Oh ok, sorted now. Thanx  .
|
|
|
08-09-2003, 10:37 AM
|
#9
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
To save yourself a reboot (after all, this is linux  ) you can just:
source /etc/profile
Cool
|
|
|
08-09-2003, 11:44 AM
|
#10
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Original Poster
Rep: 
|
Heh, cool. I'll remember that next time I need to change /etc/profile. Thanx again.
|
|
|
All times are GMT -5. The time now is 03:36 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|