set PATH permanenly
i recently downloaded and installed j2re (java runtime environment) and was advised to
make sure java binary was in my PATH. i used export PATH="$PATH:/<path to java>" which worked fine during current session but change went away when i logged out. does anyone know how to make the changes permanent? |
You can edit your ~/.bash_profile command and add 'PATH=$PATH:<path to java>"
export path If there isn't a ~/.bash_profile, bash looks for ~./bash_login or ~/.profile. If you don't have one of these files, you can create one. It is better to use a login script for this, because if you used ~/.bashrc instead, it would be executed every time you started another shell. The result you be the $PATH variable growing with the same path being added to the end. |
that is if you want to set path for individual users..if you want to set path's as global..you have to edit bashrc under /
|
To make the path global you have edit the PATH in /etc/profile
|
I have also been trying to do this, but I have had no kind of luck getting the path set to work. I'm running Mandrake 10.1, and in my /etc/profile i have ->
PATH="$PATH:/usr/X11R6/bin:/usr/java/jdk1.5.0_01/bin" I have no idea why it's not working, or if I have to add more variables than that. |
If your entry does look like this
PATH="$PATH:/usr/X11R6/bin:/usr/java/jdk1.5.0_01/bin" Try removing those quotes, I'm pretty sure you do no need them. |
The quotes are supposed to be there. Do you have the correct path?
Should be something like... :/usr/lib/java/bin:/usr/lib/java/jre/bin: |
To state what may be obvious, check the "PATH=" line mentioned, and be sure that:
- this line is actually executed (remember that there are functions, "case" and "if/then" statements there), and - the line isn't later superceded by a PATH= line that doesn't preserve your additions (ie: It doesn't have $PATH after the equal sign). Adding it as the last line in the "/etc/profile" file should fix both potential problems. That should fix it, but instead I'd suggest you add a file under /etc/profile.d, with a ".sh" suffix -- it will be used with BASH, SH, KSH, etc. echo 'PATH="$PATH:/usr/java/jdk1.5.0_01/bin"' > /etc/profile.d/java-1.5.0.sh If you're still having issues, tell us what distro+version you're running, what shell you use, what you *do* have for your $PATH and the output of: grep PATH= /etc/profile /etc/profile.d/*.sh ~/.bash* /etc/bashrc Cheers Incidentally, as long as there aren't any spaces or shell syntax tokens in the variable assignments, the double quotes are optional. [Here "tokens" include: parens, pipes, ampersands, greater/less than, and probably a few others I forgot.] |
thanks for all he input. what i finally did (that worked)
was add line to .bashrc (in both /home/user and /root) export PATH=/my/old/path:/path/addition which i then edited by deleting an extra instance of he path components '/home/user/bin and /root/bin' which the above command for unknown reason added to the end. (i deleted the instance at the end of the original path) |
This thread has just helped me to install maple 9 on Mandrake 10.1, thank you!
However a very strange thing happens once I try to use xmaple. I can start and use it but the backspace button on my keyboard (a german one) will not work. Worse than that is that e.g. x² will not work with the usual "to the power of" button. I hope I am not asking complete nonsense, but I am still very new in the linux world. Cheers |
Ooops.
sorry folks, I just had to change my keybord settings. |
Quote:
I hope this helps --Ian |
All times are GMT -5. The time now is 02:18 PM. |