Registry has value '1.8', but '1.7' is required

Q

I have JDK 7 stored C:\java\jdk1.7 folder. When I run the "C:\java\jdk1.7\bin\java -version" command, I am getting the following error:

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.

✍: FYIcenter.com

A

You are getting this error, mostly because the "C:\java\jdk1.7\jre" folder is missing. This .\jre folder contains java.dll and other important files to run JVM.

When you invoke "C:\java\jdk1.7\bin\java.exe", it will try to find java.dll in "C:\java\jdk1.7\jre". If not there, it will check the registry 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion', which is pointing a JDK 8 JRE folder somewhere else on your hard disk. This is why the error message says: "Registry key ... has value '1.8', but '1.7' is required."

2015-06-05, 7377🔥, 0💬