Installation configuration for Oracle JDK under Mac

Source: Internet
Author: User
Tags brew cask java se

I used to use the direct command. Brew Cask install Java, install the following version of Java:

?  ~  $ Ls-lh ' which Java ' lrwxr-xr-x  1 root  wheel    74B 19:07/usr/bin/java Works/javavm.framework/versions/current/commands/java?  ~  $ Java-versionjava Version "1.8.0_51" Java (tm) SE Runtime Environment (build 1.8.0_51-b16) Java HotSpot (TM) 64-bit SE RVer VM (build 25.51-b03, Mixed mode)



I wanted to install JDK1.7, so I downloaded jdk-7u80-macosx-x64.dmg from Oracle.

Next do not want to write, reproduced from http://www.bjhee.com/mac-jdk.html, but according to the situation of cyper made adjustments:
=================

The installation of Oracle JDK in Mac system is simple, but some of them are different from Linux, so make a record. This example uses JDK 1.7, also Java SE 7, as an example. However, different versions are basically the same way of installation.

    1. Download JDK
    2. Download the JDK from the official website "http://www.oracle.com/technetwork/java/javase/downloads/index.html". Remember that it is the JDK, do not download the JRE, this will lack a lot of developed libraries. Select the Mac OS x package, in this case the "jdk-7u80-macosx-x64.dmg" file is downloaded.

    1. Installing the JDK
    2. DMG Package installation is quite simple, just double-click the DMG file, follow the prompts to continue. After installation, you can find the Java settings in System Preferences. Here, we don't need to modify any settings.

  1. Configuring Environment variables
  2. We are going to add the Java command to the system environment variable "PATH". On Mac, Java is installed by default in the "/library/java/javavirtualmachines/jdk1.7.0_80.jdk/contents/home/" directory. Note that the middle "jdk1.7.0_80.jdk" directory will change depending on the version.

    Open the ". Bash_profile" file in the user directory

    $ VI ~/.bash_profile

    Add the following configuration

    0 S Export Java_home =/library/java/javavirtualmachines/jdk1.7.0_80.jdk/contents/home

    ExportPATH=$Java_home/bin:$PATH


      Enter the following command to make the configuration take effect immediately

      $ source ~/.bash_profile

      After seeing the information below, it proves that the JDK has been installed successfully.

?  ~  $ Java-versionjava Version "1.7.0_80" Java (tm) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot (TM) 64-bit SE RVer VM (build 24.80-b11, mixed mode)?  ~  $






Installation configuration for Oracle JDK under Mac

Related Article

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.