Mac下Java环境的配置
参考:
- Java 8 新特性概述:https://www.ibm.com/developerworks/cn/java/j-lo-jdk8newfeature/index.html
- Java8新特性,你应该了解这些!:https://juejin.im/post/5ae6bfb66fb9a07a9b35bac1
- Java 8 新特性:https://www.runoob.com/java/java8-new-features.html
- Java 9 新特性概述:https://www.ibm.com/developerworks/cn/java/the-new-features-of-Java-9/index.html
- Java 9 新特性:https://www.runoob.com/java/java9-new-features.html
- Java 10 新特性介绍:https://www.ibm.com/developerworks/cn/java/the-new-features-of-Java-10/index.html
- Java 10正式发布,包含 109 项新特性:https://juejin.im/entry/5ab1c64951882555880545f2
- Java 11 新特性介绍:https://www.ibm.com/developerworks/cn/java/the-new-features-of-Java-11/index.html
- Java 11新特性:https://juejin.im/post/5bb08accf265da0a87266d2a
- Java 12 新特性概述:https://www.ibm.com/developerworks/cn/java/the-new-features-of-Java-12/index.html
- Java 12 新特性:JVM历上最牛GC:https://cs.xieyonghui.com/java/jdk-12-features_95.html
JDK下载
JDK安装
查看当前的jdk
/usr/libexec/java_home -V
解压并把jdk移入JavaVirtualMachines目录
sudo mv jdk-11.jdk /Library/Java/JavaVirtualMachines/
sudo mv jdk-12.jdk /Library/Java/JavaVirtualMachines/
JDK配置
设置环境变量,在.profile文件中添加
JAVA_8_HOME=$(/usr/libexec/java_home -v1.8)
JAVA_11_HOME=$(/usr/libexec/java_home -v11)
JAVA_12_HOME=$(/usr/libexec/java_home -v12)
JAVA_HOME=$JAVA_12_HOME
再source .profile即可