Trouble setting environment variables
Hi, I've been trying to set my PATH and CLASSPATH environment variables so that they point to my JDK's bin and some Java source files respectively and this is what I've written in my .profile file: # PATH should also include the latest jdk bin directory PATH=/usr/lib/jvm/java-6-sun-1.6.0.20/bin:$PATH # set the CLASSPATH variable to include anything I do with java CLASSPATH=/home/jason/code/java:$CLASSPATH Yet I don't seem to have much luck, since echoing both environment variables gives me the old value of PATH for PATH and nothing for CLASSPATH: ja...@debian:~$ echo $PATH /usr/lib/eclipse6.0/bin/i386_linux:/home/jason/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ja...@debian:~$ echo $CLASSPATH ja...@debian:~$ This is strange, especially for PATH, because earlier in my .profile I've written: # set PATH so it includes the eclipse bin directory PATH=/usr/lib/eclipse6.0/bin/i386_linux:$PATH And if you notice the output produced by echo, this directory is well under the scope of PATH. What am I doing wrong? Do I need to export something? Thanks.
Re: Trouble setting environment variables
On Thursday 13 May 2010 10:49:35 Jason Filippou wrote: What am I doing wrong? Do I need to export something? You did log out and log back in, right? Your .profile is only read on login. -- Boyd Stephen Smith Jr. ,= ,-_-. =. b...@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/\_/ signature.asc Description: This is a digitally signed message part.
Re: Trouble setting environment variables
On Thursday 13 May 2010 13:16:21 Jason Filippou wrote: You did log out and log back in, right? Your .profile is only read on login. I actually hadn't done that, and logging in again helped with the PATH variable, but I still get nothing when echoing the value of CLASSPATH. I've changed the .profile entry to CLASSPATH=/home/jason/code/java and to CLASSPATH=/home/jason/code/java: logging out and in again in botch cases, but I'm still not in luck =/ Hrm, your .profile should be sourced in your current shell, which means exporting it wouldn't be necessary. However, I would suggest exporting it as the first attempt at a work around. -- Boyd Stephen Smith Jr. ,= ,-_-. =. b...@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/\_/ signature.asc Description: This is a digitally signed message part.
Re: Trouble setting environment variables
On Thu, May 13, 2010 at 06:49:35PM +0300, Jason Filippou wrote: Hi, I've been trying to set my PATH and CLASSPATH environment variables so that they point to my JDK's bin and some Java source files respectively and this is what I've written in my .profile file: # PATH should also include the latest jdk bin directory PATH=/usr/lib/jvm/java-6-sun-1.6.0.20/bin:$PATH # set the CLASSPATH variable to include anything I do with java CLASSPATH=/home/jason/code/java:$CLASSPATH Yet I don't seem to have much luck, since echoing both environment variables gives me the old value of PATH for PATH and nothing for CLASSPATH: ja...@debian:~$ echo $PATH /usr/lib/eclipse6.0/bin/i386_linux:/home/jason/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ja...@debian:~$ echo $CLASSPATH ja...@debian:~$ This is strange, especially for PATH, because earlier in my .profile I've written: # set PATH so it includes the eclipse bin directory PATH=/usr/lib/eclipse6.0/bin/i386_linux:$PATH And if you notice the output produced by echo, this directory is well under the scope of PATH. Perhaps the eclipse directory is added to PATH elsewhere (eg, in .profile in your home directory) or there is a separate export line in /etc/profile. What am I doing wrong? Do I need to export something? Certainly. export PATH=... export CLASSPATH=... Thanks. Cheers, David -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20100513201922.ga1...@gennes.augarten
Re: Trouble setting environment variables
On Thu, 2010-05-13 at 14:48 -0500, Boyd Stephen Smith Jr. wrote: On Thursday 13 May 2010 13:16:21 Jason Filippou wrote: You did log out and log back in, right? Your .profile is only read on login. I actually hadn't done that, and logging in again helped with the PATH variable, but I still get nothing when echoing the value of CLASSPATH. I've changed the .profile entry to CLASSPATH=/home/jason/code/java and to CLASSPATH=/home/jason/code/java: logging out and in again in botch cases, but I'm still not in luck =/ Hrm, your .profile should be sourced in your current shell, which means exporting it wouldn't be necessary. However, I would suggest exporting it as the first attempt at a work around. What happens if you set it in /etc/environment instead? - John -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/1273796274.3493.4.ca...@localhost
Re: Trouble setting environment variables
On 05/13/2010 11:15 AM, Boyd Stephen Smith Jr. wrote: On Thursday 13 May 2010 10:49:35 Jason Filippou wrote: What am I doing wrong? Do I need to export something? You did log out and log back in, right? Your .profile is only read on login. Why not just re-source the file? $ . .profile -- Dissent is patriotic, remember? -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4bec9f2c.6030...@cox.net