Setting Java home enviroment variable in OSX Mavericks

纵然是瞬间 提交于 2019-12-02 10:16:30

Check whether there is an old version existed in the path

echo $PATH

Then set the java 1.7 bin directory.

export PATH=/usr/libexec/java_1.7_home/bin:$PATH

Then try to type in "java -version" in terminal to check the version

Ok, I think this must be specific to me. As above the Java control panel was saying that java 7 was installed. Also when i tried

/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version

I would get

java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)

But no mater what way I installed the JDK it would not work. It just didn't seem to appear anywhere on my machine. I still don't know why, but uninstalling (by simply deleting the 1.6 folder) the existing Java 6 from my machine and once again installing Java 7 JDK eventually fixed it.

Please give the up-votes to @diaz994 above.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!