jdk 1.8 安裝
- 1、官網(wǎng)下載JDK
鏈接:https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
選擇mac jdk版本
下載jdk - 2、安裝jdk
雙擊安裝jdk,傻瓜安裝即可 - 3、配置變量
打開(kāi)終端 進(jìn)入home目錄
cd ~
打開(kāi)編輯.bash_profile
open .bash_profile
如果出現(xiàn)The file /xxxx/.bash_profile does not exist的情況,需要?jiǎng)?chuàng)建.bash_profile文件
touch .bash_profile
然后再open .bash_profile,在彈出的操作框中輸入
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_25f1.jdk/Contents/Home
并保存
這時(shí)在終端輸入
java -version
就能看到安裝成功了
