MAC environment variable Modification User Environment variables
1. Modify FILE: $vi ~/.bash_profile
2. Add a path to the file: path= $PATH:p ath1:path2:pathn (path is replaced with the paths you need)
3. Refresh: $source. bash_profile
4. See if the success: $echo $PATH
If the system is updated, the configuration may fail, and the system environment variable should be configured if it is permanently changed
System Environment variables
1. Mac system By default the file that we want to edit is read-only, so modify the file permissions first $sudo chmod 777/etc/profile
2. Enter your password
3. $vi/etc/profile
4. Add a path to the file: path= $PATH:p ath1:path2:pathn (path is replaced with the paths that you need, separated by a half-width colon between each path)
5. Save and exit
6. Restore file permissions: $sudo chmod 444/etc/profile
7. Restart your computer
8. Open terminal to see if it was successful: \ $echo \ $PATH
Appendix 1 Common Path addresses
Java:
Java_home= "/home/fuke-ubuntu/android/jdk1.8.0_25" classpath=.:\ $JAVA _home/lib/dt.jar:\ $JAVA _home/lib/tools.jarpath=\ $PATH: \ $JAVA _home/bin:\ $JAVA _home/jre/bin
Appendix 2 References
How MAC OS Java environment variables are configured
Linux file permissions
Modify Linux file Permissions chmod
Digital representation in file permission settings under Linux
MAC environment variable Modification