I've been learning Android and had installed Java 1.7. I installed Java 1.8 to get the latest version. After installing I opened a command prompt and typed in "java -version" to make sure everything had installed properly. Woops, got the nastiness below!
C:\windows\system32> java -version
Error: Registry key
'Software\JavaSoft\Java Runtime Environment'\CurrentVersion' has value '1.8', but
'1.7' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
Lots of hits out
there about modifying registry and deleting files to fix the error. Those seemed messy. Here's a simpler fix that worked for me.
Open Control Panel\All Control Panel Items\Programs and Features
Uninstall new version of java (1.8)
Uninstall old verrsion of java (1.7)
Install java 1.8
Set java_home to new variable via ENVIRONMENT to point to the java 1.8 path
Good to go after that point.
C:\windows\system32>java -version java version
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM)64-Bit Server VM (build 25.51-b03, mixed mode)