JDK installation method under Mac environment

Source: Internet
Author: User

1. Version

MAC OS 10.10.3

Jdk:jdk1.8.0_40

JDK download for Mac version: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2. Unzip the JDK package to a path

/library/java/javavirtualmachines/jdk1.8.0_40.jdk/contents/home

3. Configure Environment variables

Open the user-level system environment variable profile open ~/.bash_profile (zsh open ~/.ZSHRC file is installed)

Adding configuration parameters

Export java_home= '/library/java/javavirtualmachines/jdk1.8.0_40.jdk/contents/home '

Export path= $JAVA _home/bin: $PATH

Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

4. Verifying the installation results

Reboot to ensure system configuration file re-read takes effect

Terminal input: Java-version

The following information is displayed to indicate that the JDK was successfully installed:

Java Version "1.8.0_40"
Java (TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot (TM) 64-bit Server VM (build 25.40-b25, Mixed mode)

5.QA: Why configure the system's environment variables?

When using some Java commands, such as Java Javac, and so on, the local (none of the Shell's own commands) is not found, this time need to go to the declaration of the directory to find, that is, the environment variable $path the specified directory.

Therefore, for some things that need to use the command line, you need to configure environment variables, such as Mysql,maven

JDK installation method under Mac environment

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.