Registry key Error: Java version has value '1.8', but '1.7' is required
After trying more than hundred of tricks, finally got success.
I removed all java.exe
, javaw.exe
and javaws.exe
from my
Windows\System32
andWindows\SysWOW64
folder. [Try step 2 if you have x64 system (Win 7 64 bits)]
In my case (Windows 7 64-bit), I just did the following:
- Removed the reference to C:\ProgramData\Oracle\Java\javapath; from the Path environment variable
- Removed files java, javaw and javaws from the C:\Windows\System32 folder
Afterwards, I closed all open command line consoles, reopened them and ran java -version.
re: Windows users
No. Don't remove the Javapath environment reference from your PATH variable.
The reason why the registry didn't work is that the Oracle Javapath script needs to run in the PATH sequence ahead of the JRE & JDK directories - it will sort out the current version:
put this directory at the HEAD of your %PATH%
variable:
C:\ProgramData\Oracle\Java\javapath
[or wherever it is on your desktop]
so your PATH will look something like this - mine for example
PATH=C:\ProgramData\Oracle\Java\javapath;<other path directories>;E:\Program Files\Java\jdk1.8.0_77\bin;E:\Program Files\Java\jre1.8.0_77\bin
You will then see the correct, current version:
C:\>java -version
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
- open regedit
- go to
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
- change value
CurrentVersion
from "1.8" to "1.7"