若是安裝完還提示這個錯誤,能夠javascript
vim .bash_profile
添加: java
export JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home" export PATH=${JAVA_HOME}/bin:$PATH
保存,並關閉vim
而後 bash
source .bash_profile java -version
打印:ui
java version "1.8.0_66" Java(TM) SE Runtime Environment (build 1.8.0_66-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
http://blog.csdn.net/aqiang912/article/details/50463431.net