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: