Appium---"Resolved" How Mac computers view the installation path of Java and the configuration of Java_home environment variables

Source: Internet
Author: User
Tags appium java se

Error: According to the prompt can be seen, java_home environment variable configuration errors, need to reconfigure.

1. View Java version

Turn on your Mac, view the Java version, open Terminal Terminal, and view the Java version by command

lucky:~ administrator$ java-"1.8.0_162"1.8. 0_162-   - 25.162-b12, Mixed mode)

2. Check the Java installation path:

lucky:~ administrator$ which Java/usr/bin/java    

Note that this path does not find the true path of Java, so use the following command
Use/usr/libexec/java_home-v to get the true path to Java. Enter the following directly at the terminal:

lucky:~ administrator$/usr/libexec/java_home-vmatching java Virtual machines (1): 1.8. 0_162, x86_64: "Java SE 8" /library/java/javavirtualmachines/jdk1 . 8. 0_162.jdk/contents/Home/library/java/javavirtualmachines/jdk1. 8. 0_162.jdk/contents/home

3. Setting Java_home Environment variables

If you are not currently in the root directory, use the CD to switch to the root directory, see the following code:

lucky:~ administrator$ Touch ~/. Bash_profile             //Create . bash_profile file
Lucky:~ administrator$ Open ~/.bash_profile             //Open. bash_profile file

Enter the following in the open. Bash_profile file:

Export java_home=$ (/usr/libexec/java_home) export PATH= $JAVA _home/bin: $PATHexport class_path=$ Java_home/lib

After the input is complete, save, and again enter the following in the terminal to make the content added to the. bash_profile file Effective

lucky:~ administrator$ Source ~/.bash_profile

Complete the above operation and enter Appium-doctor again to see that the configuration is successful.

Appium---"Resolved" How Mac computers can view the installation path of Java and the configuration of Java_home 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.