Mac Configuration Java_home

Source: Internet
Author: User

First open the terminal, enter/usr/libexec/java_home, see

/library/java/javavirtualmachines/jdk1.7.0_51.jdk/contents/home


Note that Java is already installed, now let's configure java_home, because this environment variable is used in many Java-related open source projects, and if it is used temporarily, enter it directly:

Export java_home=$ (/usr/libexec/java_home)
When this terminal is closed it will expire, and to set it to be permanent, we usually do this:

Create and open the ~/.bash_profile file in a TextEdit manner

Touch ~/.bash_profile;open-t ~/.bash_profile

java_home=$ (/usr/libexec/java_home-v 1.7)
Export Java_home
Finally, don't forget if. Bash_profile is just created and needs this sentence to make the configuration effective:

source. bash_profile
Finally cmd+t new window, enter

Echo $JAVA _home

To see if the configuration is global in effect

Mac Configuration Java_home

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.