Install and manage Java on Mac

Source: Internet
Author: User

Install and manage Java on Mac

After Mac OSX 10.9, the system will bring the Java 6 environment. The path is:

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

To install and upgrade to the Java 7 environment, follow these steps:

  • 1. Download the corresponding JDK 7 installation package from the Oracle official website. The address is here. After the installation is successful, the default path of JDK 7 is:
/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home
  • 2. Configure environment variables after installation is successful

Add the following in the. bash_profile file:

export JAVA_HOME=$(/usr/libexec/java_home)export PATH=$JAVA_HOME/bin:$PATH

Note that after Mac OSX 10.5, Apple recommends setting the $ JAVA_HOME variable to/usr/libexec/java_home.

  • 3. Enter the following command to test the configuration.
$ Java-versionjava version "1.7.0 _ 60" Java (TM) SE Runtime Environment (build 1.7.0 _ 60-b19) Java HotSpot (TM) 64-Bit Server VM (build 24.60-b09, mixed mode) # view the installed java version $/usr/libexec/java_home-VMatching Java Virtual Machines (3): 1.7.0 _ 60, x86_64: "Java SE 7"/Library/Java/JavaVirtualMachines/jdk1.7.0 _ 60.jdk/ Contents/Home1.6.0 _ 65-b14-462, x86_64: "Java SE 6"/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home1.6.0 _ 65-b14-462, i386: "Java SE 6"/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home # Return the highest java version installed on the System $/usr/libexec/java_home/Library/Java/JavaVirtualMachines /jdk1.7.0 _ 60.jdk/ Contents/Home

Install JDK 7 In Ubuntu (with Clojure download)

Install JDK 12.04 in Ubuntu

Install Oracle JDK 14.04 on Ubuntu 1.8 LTS

CentOS6.3 install JDK and environment Configuration

Install JDK 8 on Ubuntu 14.04

Install JDK graph analysis in Ubuntu

This article permanently updates the link address:

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.