Set environment variables on mac

Source: Internet
Author: User


Set environment variables on mac to develop programs in unix/linux-based operating systems. It is convenient to use environment variables. By setting environment variables, you can enter the program name in any directory to execute the program under the Set directory. You do not need to change the working directory to the program directory through cd before executing the program. It also saves the trouble of inputting. To put it bluntly, take the following steps (under bash): www.2cto.com 1, open the application-> utility-> terminal; 2, locate your user's home directory in the terminal, and enter: cd ~ 3. Create an empty file and enter touch. bash_profile; 4. Edit this file and enter: open. bash_profile; 5. In this file, enter: export PATH =$ {PATH }:< file directory >;( Replace "<file directory>" with the desired directory) export PATH =$ {PATH}:/Users/rye/android/android-sdk-mac_x86/tools; 6. If you need to add other environment variables such as JAVA_HOME, enter: export JAVA_HOME =/Library/Java/Home; 7, source. bash_profile restart the terminal and test. Author abc20899

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.