How can I permanently add a class path to my Mac terminal?

坚强是说给别人听的谎言 提交于 2019-11-30 21:29:27

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!

I tried different things, I could only set temporarily. Atlast tried this and got worked

echo 'export PATH=$PATH:/User/Documents/adt-bundle-mac-x86_64-20140702/sdk/platform-tools:/User/Documents/adt-bundle-mac-x86_64-20140702/sdk/tools' >> ~/.bash_profile

this will set the path permanently.

/User/Documents/adt-bundle-mac-x86_64-20140702/sdk this is my Android SDK path

Navaneetha Krishnan P

Set classpath in your bashprofile and close the terminal and restart it will work sure

Do the following:

1- vi .bash_profile {open in terminal} home directory
2- add this line export CLASSPATH=$CLASSPATH:/{//directory//}

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!