cd /etc
vim profile
在下面添加自己要配置的变量,我自己的环境变量为例:
export JAVA_HOME=/usr/java/jdk1.8.0_131
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
export ARM_HOME=/usr/local/linaro-multilib-2014.06-gcc4.9
export PATH=$PATH:$ARM_HOME/bin
export ANDROID_NDK_HOME=/usr/android/android-ndk-r16
export PATH=$ANDROID_NDK_HOME:$PATH
export OPENSSL=/usr/local/openssl/bin
export PATH=$OPENSSL:$PATH:$HOME/bin