Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to add /home/myname/adt-bundle-linux-x86_64-20130219/eclipse to PATH.

I edited .profile:

PATH="$HOME/bin:$PATH:/home/myname/adt-bundle-linux-x86_64-20130219/eclipse"

but it won't work. Why?

When I instead save export PATH=/home/myname/adt-bundle-linux-x86_64-20130219/eclipse:$PATH in a file in /etc/profile.d/ and do chmod a+x it works.

Both should work. I would like to understand why the first option does not work.

share|improve this question
1  
Have you tried adding export to .profile as well? –  choroba Apr 29 '13 at 15:47
    
Yes I tried that but it did not work. –  chrismeo Apr 29 '13 at 16:23
    
Actually, some clarification required: what "doesn't work"? Does the new directory fail to appear in $PATH? –  glenn jackman Apr 29 '13 at 19:15

1 Answer 1

Is /home/myname/adt-bundle-linux-x86_64-20130219/eclipse a directory or actually the program you want to execute? If the latter, your .profile should contain

PATH="$HOME/bin:$PATH:$HOME/adt-bundle-linux-x86_64-20130219"
share|improve this answer
    
No the program I want to run, eclipse, is in the directory home/myname/adt-bundle-linux-x86_64-20130219/eclipse –  chrismeo Apr 29 '13 at 16:22
    
After you edited ~/.profile, did you re-source it? . ~/.profile –  glenn jackman Apr 29 '13 at 16:23
    
Also, do you have a ~/.bash_profile file? If you do, bash won't read ~/.profile -- gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files –  glenn jackman Apr 29 '13 at 16:25
    
No I do't have a ~/.bash_profile, and yes I did source it after editing. –  chrismeo Apr 29 '13 at 19:01
    
Oh I am so embarrassed! Thanks Glenn for you effort!!! I can't even vote you up cos I am new. It works exactly liked you wrote, and I had done it like that, except that I added the new path between if and fe and since I do not have a /bin directory in my home directory I could wait forever that my path will be exported. –  chrismeo Apr 29 '13 at 21:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.