macbook安装java终端输入java -version显示No Java runtime present, requesting install.

去oracle官网下载了JDK安装好以后。终端输入java -version一直显示No Java runtime present, requesting install.
解决办法为:
在终端中输入
vim .bash_profile
添加:
export JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"

export PATH=${JAVA_HOME}/bin:$PATH
保存,并关闭
然后 source .bash_profile

你可能感兴趣的:(macbook安装java终端输入java -version显示No Java runtime present, requesting install.)