Mac OSX-How to configure Global environment variables in Bash_profile

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.