How to update Java from 8 Update 31 to 8 Update 51 when install fails? I'm trying to update Java on my Mac OSX Yosemite.  In the Java Control Panel, it states:

A critical Java security update is available.

8 Update 51 (57 MB)

Your current version is Java 8 Update 31. It is recommended that you update 
now to keep your system secure.


I click the Update Now button and it brings up the Software Update dialog that indicates I must relaunch the browser to update, but it will not need to reboot the computer.  I click the Install Update button which brings up the Updating Java dialog that downloads 60 MB, extracts it, and then very briefly says ready to update before disappearing.  Returning to the Java Control Panel shows I'm still on Update 31, repeating the process has same result.

How can I get the update to actually install?
No need to uninstall the current version. From the Java website just download the Java 8 update 51 (JDK)from Oracle site and install manually. After installation, no need to reboot the machine. Check version in Terminal or Java panel. It will show the updated version.