Mac system configuration JDK1.8 environment variables

Source: Internet
Author: User

1. First we need to know where the JDK directory is installed, follow the path below and we can find the JDK's home directory as shown in. There are two directories here because earlier versions of JDK1.8 were installed earlier in this machine.

/library/java/javavirtualmachines;

2. Because of the Mac file system structure, unlike Windows, the true home directory of the JDK is as follows:

/library/java/javavirtualmachines/jdk1.8.0_171.jdk/contents/home;

3. Open the terminal terminal, the default is open in their home directory, you can also directly from the CD command to jump home directory.

Open the startup file and modify the contents via vim. bash_profile command;

Enter vim and press I to enter the edit state. Add the following (modify jdk1.8.0_171 based on your own installation of the specific version). Press ESC again and enter ": Wq" to save the exit. Configure the system environment variable to end.

Export Java_home=/library/java/javavirtualmachines/jdk1.8.0_171.jdk/contents/home

4. Verify that the JDK1.8 is installed successfully.

In the terminal input Java, there is the following screen to prove the success of the configuration

or enter Java-version, with the following version information

Reference connection: 78046007

Mac system configuration JDK1.8 environment variables

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.