-   Linux - Newbie (
-   -   PATH and JAVA_HOME (

peteABK 10-17-2003 07:03 PM

Quick question about the above variables,

when ever I set them through the shell


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


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


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:

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