Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

I edited .profile:


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
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

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

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 -- – 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


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.