Configuring JDK Environment variables under MAC system

Source: Internet
Author: User

The first time with the development of the Mac, on the Internet also search some environment variable configuration articles, summarized in this to facilitate future use.

1, open terminal terminal;

2, enter the current user home directory, CD ~;

3, temporary authorization, sudo su;

4, enter the password (password does not display);

5. Create a. bash_profile file, touch. Bash_profile (if there is no new, I do not);

6. Open the. bash_profile file, opening bash_profile (can open then new success);

7, the input JDK file path, the system default is 1.6, my is 1.8, can be configured for two, convenient later switch.

Export Java_6_home=/library/java/javavirtualmachines/1.6.0.jdk/contents/home

Export Java_8_home=/library/java/javavirtualmachines/jdk1.8.0_51.jdk/contents/home

Export Java_home= $JAVA _8_home

Save and exit;

8. Read and execute the commands in the file, source. bash_profile;

9. Enter Java-version in terminal to display JDK information, then the configuration is successful.

Transfer from https://www.cnblogs.com/zhouhongfu1991/p/5967807.html

Configuring JDK Environment variables under MAC system

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.