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