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.
|
add it to the user's .bashrc and/or .bash_profile for a single user
or to /etc/profile for everybody |
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. :D |
dont you mean /usr/local/java/bin, not /usr/local/java?
|
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' :/. |
Quote:
|
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 :)) |
Oh ok, sorted now. Thanx :).
|
To save yourself a reboot (after all, this is linux ;) ) you can just:
source /etc/profile Cool |
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 08:36 AM. |