The basic issue: /usr/bin/java
is pointing to one provided by OSX itself initially (/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
)
We need to point this to the one downloaded by the JDK installer. The below steps are for OSX 10.10.4 Yosemite.
Path
item and copy the path (cmd+c). This is the latest one installed by the JDK installer/updater. In my case, the path was /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
ln -s
command) the system java binary to the latest one, which we discovered in the previous step. Run the below command:sudo ln -s /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java /usr/bin/java
Thats it. To verify, you can just run
java -version
on the terminal. It should output the latest version that you installed/updated to.