Attention:
Install a high version of the JDK on the Mac, the best practice is not to uninstall the system comes with the jdk1.6, because a lot of IDE boot needs jdk1.6 support, of course, we can also modify the IDE's configuration file, but also cannot modify each, in order to avoid trouble, It is recommended to keep the system's own jdk1.6
First, download
Second, installation
java -version
Go to-->mac OS--Resource library-->java-->javavirtualmachine
Third, the configuration
vi ~/.bash_profile
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
Export path= $JAVA _home/bin:
source ~/.bash_profile
Note: This configuration method only applies to user environment variables, if the system updates, the previous configuration may fail, if you want to permanently change the configuration in the/etc directory in the profile file
JDK installation in a Mac environment