Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

environment variable



On Sun, 18 Apr 2004 11:17:17 -0400
"D.E. Chadbourne" <235u at comcast.net> wrote:

> hi.  what's the best way to set the environment variable globally? 
> i'm screwing this thing up.  below is my lame attempt.  thanks for any
> info, eric.
> 
> [root at mathPlayPen eric]# export 
> PATH="$PATH:/opt/j2sdk_nb/j2sdk1.4.2/jre/bin"
> [root at mathPlayPen eric]# /usr/bin/jedit
> Warning: JAVA_HOME environment variable not set.
> [root at mathPlayPen eric]#
With respect to the other answers and solutions:
You cannot export an environment variable to other processes already
running at the time. The only way another process may inherit an
environment variable is a child process. In the above case, you could
have exported JAVA_HOME before you ran jedit. 
export PATH="$PATH:/opt/j2sdk_nb/j2sdk1.4.2/jre/bin
export JAVA_HOME=/opt/j2sdk_nb/j2sdk1.4.2/jre/lib
/usr/bin/jedit

Assuming this is the correct location for JAVA_HOME.

Probably the best way to do this is in your .bashrc and/or your
.xsession or best in /etc/profile

On my system it is done when /etc/profile sources
/etc/profile.d/alljava.sh.

This way you will get all the appropriate JAVA environment variables. 

One of the most confusing issues I find in my Linux class is trying to
explain the difference between environment variables in Unix/Linux and
Windows. In Windows, all envornment variables are global and one process
can side effect another. In Unix/Linux, this cannot occur. 

-- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.blu.org/pipermail/discuss/attachments/20040418/303c3870/attachment.sig>



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org