Installation
Because not all users need Java, OS X is not pre-installed in Java by default, and can be installed manually if you want.
1. http://support.apple.com/kb/DL1572
To the Apple website to download.
Http://support.apple.com/downloads/DL1572/en_US/JavaForOSX2014-001.dmg
2.http://www.oracle.com/technetwor ... ownloads/index.html
Download the latest version of the Java 8 JDK installation to Oracle.
After installation in the terminal input
If the version is displayed, the installation is ready.
If it appears as follows, it means that the right is not installed and needs to be restarted.
No Java Runtime present, requesting install.
Find and set the $java_home on the Mac
You can use the tool command "/usr/libexec/java_home" to locate Java_home:
Locate Java:
Matching java Virtual Machines (1):
1.8.0_25, x86_64: "Java SE 8"/library/java/javavirtualmachines/jdk1.8.0_ 25.jdk/contents/home
/library/java/javavirtualmachines/jdk1.8.0_25.jdk/contents/home
You can also use the-V option to list all versions of Java_home:
$/usr/libexec/java_home-v
Matching java Virtual Machines (3):
1.7.0_45, x86_64: "Java SE 7"/library/java/javavirtualmachines/jdk1.7.0_45.jdk /contents/home
1.6.0_65-b14-462, x86_64: "Java SE 6"/system/library/java/javavirtualmachines/1.6.0.jdk/ Contents/home
1.6.0_65-b14-462, i386: "Java SE 6"/system/library/java/javavirtualmachines/1.6.0.jdk/contents/ Home
/library/java/javavirtualmachines/jdk1.7.0_45.jdk/contents/home
Configure Java_home:
$ cat ~/.profile
java_home= '/usr/libexec/java_home '
export java_home
$ echo $JAVA _home
/library/ Java/javavirtualmachines/jdk1.7.0_45.jdk/contents/home
$ source ~/.profile
$java