I want to set my path permanently for the following directory:
/Users/syalam/Library/android-sdk-mac_86/platform-tools
Not sure how to do it from the terminal. I tried:
export PATH=$PATH:/Users/syalam/Library/android-sdk-mac_86/platform-tools
but it only works temporarily. After I close my shell it no longer exists.
For a new path to be added to PATH environment variable in MacOS just create a new file under /etc/paths. d directory and add write path to be set in the file. Restart the terminal. You can check with echo $PATH at the prompt to confirm if the path was added to the environment variable.
Just add this entry to your CLASSPATH
environment variable in your .bashrc
:
export CLASSPATH="/Users/syalam/Library/android-sdk-mac_86/platform-tools:$CLASSPATH"
http://blog.just2us.com/2011/05/setting-path-variable-in-mac-permanently/
Set permanently for a user:
Edit the user’s bash profile (replace USERNAME)
pico ~USERNAME/.bash_profile
Insert (or edit) this line
PATH=$PATH:/my/new/path/
Press ctrl-x, then ctrl-y, to save the file.
Done.
Set for all users
sudo pico /etc/paths
Enter your superuser password to edit, and insert or edit this link
PATH=$PATH:/my/new/path/
That’s it! Enjoy your path!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With