We know that under the Linux operating system, the configuration environment variable is using the following command:
Vim/etc/profile
Under OSX, we open the environment variable configuration file with the following command:
Open ~/.bash_profile
The typical environment variables are configured as follows:
# Javaexport Java_home=/home/myuser/jdk1.7. 0_03export PATH= $JAVA _home/bin: $PATHexport CLASSPATH=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar# hadoopexport hadoop_home=/users/yourusername/documents/dev/hadoop-2.7.3Export PATH= $PATH: $HADOOP _home/bin: $HADOOP _home/sbin# spunkexport splunk_home=/applications/Splunkexport PATH= $PATH: $SPLUNK _home/bin# Setting PATH forPython3.5# The original version is savedinch. Bash_profile.pysavepath="/library/frameworks/python.framework/versions/3.5/bin:${path}"Export Pathexport CLASSPATH=${classpath}:/users/yourusername/documents/lib/hadoop_cli# antexport ant_home=/users/yourusername/documents/dev/apache-ant-1.9.7Export PATH= $PATH: ${ant_home}/bin# jbossexport jboss_home=/users/yourusername/documents/dev/wildfly-10.1.0. Finalexport PATH= $PATH: $JBOSS _home/bin# m2_homeexport m2_home=/users/yourusername/documents/dev/apache-maven-3.3.9Export PATH= $PATH: $M 2_home/bin
Finally, don't forget to compile the
source. bash_profile
Mac OSX-How to configure Global environment variables in Bash_profile