Recently the update for Java on my Macs failed to install. This is the first time I see an update from Apple not work on my machines. This happened both on my iMac and on my MacBook Pro.
To fix this, I got the update directly from Apple and installed it manually, you can find it here:
It all seemed to work fine after that, I just had to install it as a normal application. I'm not sure why this happened.