LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Things not staying in PATH? (https://www.linuxquestions.org/questions/linux-general-1/things-not-staying-in-path-11456/)

phishead 01-09-2002 09:44 PM

Things not staying in PATH?
 
I installed java to run a program and put it in the PATH.. program ran fine. When I went back later it said java command not found..

I put it in the path again.. same thing, it worked once then stopped.

Im putting it the path with the following command:

export PATH=/home/name/j2re1.3.1/bin:$PATH

any ideas?

neo77777 01-09-2002 11:01 PM

you should add the export line you wrote to /etc/profile file at the end, so every user who is loged into the system will have the same chunk of it. If you'd like to keep it only to a particular user add the java bin directory to $PATH in .bash_profile file in the users home directory. Don't forget to run
source /etc/bashprofile
or
source .bash_profile
to make changes happen immediatly.

phishead 01-10-2002 03:39 PM

Im having a problem getting it in my etc/profile file.. And in my .bash_profile.

What code would I put in?

neo77777 01-10-2002 04:42 PM

as root open for editing /etc/profile file
i am not using GUI editors so I can't tell you wich one is better, if you work from console and not famiiar with emacs, vi or any other console editors, I found the easiest to use for a newbie is pico
in console as root type
pico /etc/profile

It will open the file in console navigate by using arrow keys, go to the end and type

export PATH=/home/name/j2re1.3.1/bin:$PATH
save the file ( in pico hit ctrl-O and then ctrl-X to save and quit)
then from the console as root run

source /etc/profile
as a non-root run the same command to make changes for non-root user who currently logged in (yourself)
it will make the PATH permanent for you as root and for you as yourself on the system

phishead 01-10-2002 06:16 PM

Got it working, thanks

neo77777 01-10-2002 07:10 PM

No problems


All times are GMT -5. The time now is 04:41 PM.