Recently I installed Android Studio. Now I want to add android-studio/bin/ persistently to PATH environmental variable as Session-wide environment variables
and not as System-wide environment variables
. To do that I tried to edit ~/.profile
as described here. So I have these at the end of ~/.profile
:
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH:/usr/local/Android/android-studio/bin"
fi
Then I re-login to initialize the variable. But when I run studio.sh
in terminal, I get this:
studio.sh: command not found
Here are results of $PATH
and echo $PATH
:
$ $PATH
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:
No such file or directory
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Also I'm sure that ~/.bash_profile
and ~/.bash_login
do not exist. Now what cause the problem and how I can solve that?
Edit:
I change end of ~/.profile
to this, but it does not work:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
PATH="$PATH:/usr/local/Android/android-studio/bin"
fi
if
andfi
. As long as you keep it where it is now, you can sayPATH="$PATH:/some/directory:/some/other/directory"
– Gunnar Hjalmarsson Jan 30 '16 at 18:11studio.sh
, I suppose. (I don't use the program myself.) – Gunnar Hjalmarsson Sep 21 '16 at 18:17