LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   PATH and JAVA_HOME (https://www.linuxquestions.org/questions/linux-newbie-8/path-and-java_home-105343/)

peteABK 10-17-2003 07:03 PM

PATH and JAVA_HOME
 
Quick question about the above variables,

when ever I set them through the shell

eg.

export PATH="$PATH:/usr/java/ja<version>/bin"

and

export JAVA_HOME="/usr/java/ja<version>"

they only last for the duration of the shell. when ever I quit and reload the shell these variables are erased. I am trying to export them as the root user, but I can't figure out why they don't last, any help is greatly appreciated.

micxz 10-17-2003 07:18 PM

In your home directory, just add them to the appropriate .profile or rc file for your shell. e.g. .profile .bashrc .bash_profile

peteABK 10-19-2003 10:43 AM

If I do this in the root directory will it aply to all users?

micxz 10-19-2003 04:20 PM

No.

in /etc if you want it system wide. But usually this is not needed because you may alter the environment of the users shell that your logged into. So why make it system wide when you only need it for one app?

Hint: . or dot files in a users home directory are configuration setting and evironment setting for that users shell and programs. Not the whole system!

megaspaz 10-19-2003 04:30 PM

setting your java path system wide:

http://www.linuxquestions.org/questi...highlight=java


All times are GMT -5. The time now is 09:55 AM.