Ubuntu: setting environment variables

≡放荡痞女 提交于 2021-01-29 18:30:40

问题


I need set environment variables for Android Studio project EVERY TIME when reboot or close terminal. (Ubuntu 14.04) For setting variables I use:

export KEYSTORE_NAME=/home/anna/Documents/keys/NAME.keystore 
export KEYSTORE_NAME_PASSWORD=PASSWORD
export KEY_NAME_ALIAS=NAME
export KEY_NAME_PASSWORD=PASSWORD

How can I set there variables forever?


回答1:


Put those lines in

/home/anna/.bashrc

or in

/home/anna/.bash_profile

depending on which file you use. I think it is

.bashrc

in Ubuntu by default. If you want to make changes made to that file be effective without restarting run command:

source /home/anna/.bashrc



来源:https://stackoverflow.com/questions/26253375/ubuntu-setting-environment-variables

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