Linux:配置环境变量文件
/etc/profile下面加入:
if [ -f /opt/evn.sh ]; then
. /opt/evn.sh
fi
/opt/evn.sh内容:
alias cls='clear'
PS1='\n*********************** \A \w\n> '
export JAVA_HOME=/opt/jdk1.8.0_151
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export SCALA_HOME=/opt/scala-2.11.8
export PYTHON_HOME=/opt/python3.6.6
export SPARK_HOME=/opt/spark-2.3.0-bin-hadoop2.7
export HADOOP_HOME=/opt/hadoop-2.7.5
export HBASE_HOME=/opt/hbase-1.4.0
export HIVE_HOME=/opt/hive-2.3.3
export KAFKA_HOME=/opt/kafka_2.11-1.1.0
export PATH=$JAVA_HOME/bin:$SCALA_HOME/bin:$PYTHON_HOME/bin:$HADOOP_HOME/bin:$HBASE_HOME/bin:$SPARK_HOME/bin:$HIVE_HOME/bin:$KAFKA_HOME/bin:$PATH