Unable to find suitable jdk installation Please make sure you have a suitable jdk installation

Hi all,
yesterday I got this nasty error while trying to build an apk for the first time with Unity 5 64 bit.
I have Windows 7 64-bit with the latest 64-bit java version.
I’ve tried all solutions suggested in this thread:

but none seemed to work.

Thankfully, I also had an old, 32-bit Unity 4.6 installation on my pc: I tried building a test android project with it and it worked without a hitch.

Now, I’d be inclined to think that using a 32 bit version of Unity is what made the difference; still, I find it hard to believe that a 32 bit application is compatible with a 64 bit java installation while a 64 bit application is not.

Did anyone have a similar experience? The most obvious next step would probably be to install the latest 32-bit java version and see if it makes a difference, but I’m a little reluctant on proliferating java versions for a reason that doesn’t even make much sense to me.

Any suggestion would be much appreciated.

For the record, I’ve installed jdk 32 bit and now Unity 64-bit can build without problems.
Sounds crazy to me but hey, as long as it works…