Since you're using linux, I'll give my examples assuming you're using
bash as your primary shell. I've usually had the best luck setting
environment variables in my .bashrc file and deleting my .bash_profile
and then setting .bash_profile as a symlink to my .bashrc.
To see what I'm talking about, check out the contents of your .bashrc
and .bash_profile.
$ cd
$ cat .bashrc
$ cat .bash_profile
Be sure to copy anything important out of .bash_profile into
.bashrc. Of course, if you just append the contents, it will save some
time.
$ cat .bash_profile >> .bashrc
$ rm .bash_profile
$ ln -s .bashrc .bash_profile
Now, to actually set your environment, add the following lines to your
.bashrc in your favorite editor.
export JAVA_HOME=/usr/java/jdk1.3
export PATH=$PATH:$JAVA_HOME/bin
Don't forget the 'export' in your script or the environment variable
will not be set in child processes (such as scripts or programs you
launch.)
On Mon, Apr 09, 2001 at 09:36:25AM +0800, Liuchao wrote:
> I have installed JDK1.3.0 in directory /usr/java/jdk1.3. and I use echo $PATH, the
>$JAVA_HOME have not been set.
> I set $PATH=/usr/java/jdk1.3/bin every time when I login in my computer. How can I
>do to let $PATH have been set
> automatic everytime when I login in my linux.
>
> Thank you,
> Chao Liu
> [EMAIL PROTECTED]
> 2001.4.9
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]