Click to See Complete Forum and Search --> : Adding paths in Mandrake 8


Clutch
08-13-2001, 06:32 PM
I need to add some stuff to my path i.e. archiving and java cause i'm tired of having to run them as root, but I'm not sure how to do it with mandrake. I check my .bash_profile and their is no entry for PATH. Yet, an echo on path yeilds several lines.... I must be doing something quite wrong, could someone tell me EXACTLY how to add a Path? I figured this has been discussed before but the forum search isn't working for me........... :confused:

Malakin
08-13-2001, 07:25 PM
User added environment variables are supposed to go in $HOME/.bash_profile, environment variable you wish to effect everyone go into /etc/profile.

Just add something like this to either of those files, substituting /usr/local/bin for whatever path you would like to add.

PATH=$PATH:/usr/local/bin
export PATH

For something like Java people usually make a link to /usr/bin/.
Example "ln /usr/java/jre1.3.1/bin/java /usr/bin/java -s"

[ 13 August 2001: Message edited by: idealego ]

Dru Lee Parsec
08-13-2001, 08:09 PM
Just a few clarifiers:

THe $PATH portion of the message above means "The Current Path" So

export PATH=$PATH:/home/greg/newstuff

will append /home/gregb/newstuff onto the end of the existing path. If you did this:

export PATH=/home/greg/newstuff

It would overwrite your existing path.

Also, if you put a path statment in /etc/profile then it exist for all users. If you put it in your.bash_profile then it exist for you alone and is only updated when you log in. If you put it in .bashrc then it exist for you alone and it's updated every time you open a new terminal window.

For more info on how to install Java on Linux check out my NHF on that subject at http://www.linuxnewbie.org/nhf/intel/programming/javaintro1.html

Hope it helps.