3

I recently installed Android Studio , and to make the changes permanent I changed the PATH environment variable in .bashrc file, as shown in Second answer of this link.

I get following error messages or warning sort of things every time I launch a new terminal window.

bash: export: '=': not a valid identifier

bash: export: /home/android-studio/bin/:/usr/games:/home/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin: ~/android-studio/bin': not a valid identifier`

This is what I did I opened .bashrc file using following command

nano .bashrc

then added following lines to .bashrc file.

export PATH = "$PATH:~/android-studio/bin"

Following is value in my path Variable

bash: /home/android-studio/bin: Is a directory
2
  • What is given when you run echo $PATH, and what line did you add to your .bashrc file? And did you run the echo 'export PATH="~/android-sdk/android-studio/bin/:$PATH"' >> ~/.bashrc command? You many need to run source ~/.bashrc or login/logout after making chanes to the ~/.bashrc file (may not be a good idea if it is broken though)
    – Wilf
    Feb 20, 2015 at 16:44
  • 1
    Could you add output of this command to question: grep "export" ~/.bashrc
    – c0rp
    Feb 20, 2015 at 16:45

1 Answer 1

2

Remove spaces between = sign. It should look like:

export PATH="$PATH:~/android-studio/bin"

not

export PATH = "$PATH:~/android-studio/bin"
4
  • So linux is whitespace sensitive as well?? It works thanx
    – Chinmaya B
    Feb 20, 2015 at 16:55
  • @Creator not Linux, but bash is sensitive to spaces
    – c0rp
    Feb 20, 2015 at 16:59
  • 1
    Can I suggest using "$PATH:$HOME/android-studio/bin" (since ~ doesn't get expanded withing double-quotes)? Feb 20, 2015 at 17:02
  • Yes that would work too
    – Chinmaya B
    Feb 20, 2015 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .