MacOS Sierra installation JRE8, configuring environment variables

Source: Internet
Author: User

My MacOS Sierra version number 10.12.2, the JRE package installed is: JRE-8U112-MACOSX-X64.DMG



After you double-click Normal installation, entering java-version under terminal does not display the version properly, you need to configure environment variables.


Here's how:


Open Terminal, enter the following to create a profile in the current user directory:

VI ~/.bash_profile


Click the I key to enter edit mode, paste the following content:

Java_home= "/Library/Internet Plug-ins/javaappletplugin.plugin/contents/home"

Path= $JAVA _home/bin: $PATH

Classpath=.: $JAVA _home/lib

Export Java_home

Export CLASSPATH

Export PATH


Then click the ESC key, enter: Wq Save exit


Finally, run the command update under Terminal to make the configuration effective:

source. Bash_profile  


Enter java-version under Terminal to display the version successfully, if not, please log out.

MacOS Sierra installation JRE8, configuring 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.