Where to set environment variables

Jan Kokoska kokoskaj at seznam.cz
Wed Oct 20 12:49:38 UTC 2004


On Wed, 2004-10-20 at 13:30 +0100, Darren Wheatley wrote:
> Hi,
> 
> Can anyone tell me definitively where to put environment settings please?
> 
> I have installed the j2sdk from Sun, but need to alter my PATH to point 
> to it.
> 
> I have tried adding the following to ~/.gcprofile, ~/.bash_profile, and 
> ~/.bashrc but nothing seems to set my path properly:
> 
>     export PATH=$PATH:/usr/local/java/bin
> 
> I need to be able to set environment variables for both shell users and 
> server processes. Again, I tried /etc/profile for server environment 
> variables but that didn't work either.

/etc/profile typically sets PATH system-wide (to be overriden in
~/.bash_profile), so please use that. You should already have the
variable set there (and exported at the end of file) so just add to it
your java path. 

Jan





More information about the ubuntu-users mailing list