I had Java 1.8 but had to downgrade to Java 1.6 for some reason. When I uninstalled java 1.8 and ran the command "Java -Version" from the command prompt, I got the error -
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
has value '1.6', but '1.8' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
Uninstalling 1.6 and then reinstalling 1.6 fixed the issue for me :-)