<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=610323514-20102004><FONT face=Arial size=2>I'm guessing
that:</FONT></SPAN></DIV>
<DIV><SPAN class=610323514-20102004><FONT face=Arial size=2>The code in the
if-statement (in your /etc/ executes the /etc/bash.bashrc script, and
$PATH gets set in there (ie reset from what you just set it). Try
moving the "PATH=" statement to after the if (just before the export PATH
statement), and add ":$PATH" to the end of it (or else you'll again reset $PATH
after /etc/bash.bashrc executed). </FONT></SPAN></DIV>
<DIV><SPAN class=610323514-20102004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=610323514-20102004><FONT face=Arial size=2>I hope that made
sense.</FONT></SPAN></DIV>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
ubuntu-users-bounces@lists.ubuntu.com
[mailto:ubuntu-users-bounces@lists.ubuntu.com]<B>On Behalf Of </B>Bastian
Doetsch<BR><B>Sent:</B> 20 October 2004 14:59<BR><B>To:</B>
ubuntu-users@lists.ubuntu.com<BR><B>Subject:</B> Re: Where to set environment
variables<BR><BR></FONT></DIV>Am Mittwoch, den 20.10.2004, 13:49 +0100 schrieb
Jan Kokoska:
<BLOCKQUOTE TYPE="CITE"><PRE>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.
</PRE></BLOCKQUOTE><BR>Got the same problem here. Following, you can see my
/etc/profile:<BR><BR><PRE>root@basti:/home/bdoetsch # more /etc/profile
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
JAVA_HOME="/opt/jdk1.5.0"
PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/bin/X11:/usr/games:$JAVA_HOME:$JAVA_HOME/bin"
if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
export JAVA_HOME
export PATH
umask 022
</PRE><BR><BR>and here's the result when I type echo $PATH:<BR><BR><PRE>bdoetsch@basti:~ $ echo $PATH
/usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/X11:/usr/games
</PRE>So where's the error?<BR>Thanks,<BR>Bastian<BR><BR><BR>
<BLOCKQUOTE TYPE="CITE"><PRE>Jan
</PRE></BLOCKQUOTE>
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD><PRE>--
"The path of excess leads to the palace of wisdom."
- William Blake, The marriage of heaven and hell
</PRE></TD></TR></TBODY></TABLE></BLOCKQUOTE></BODY></HTML>