by BehindJava
How to resolve the Error opening registry key Java
In this blog, we are going to learn about resolving the Error opening registry key ‘Software\JavaSoft\Java Runtime Environment.3’. There are 3 locations to check.
- Registry HKEYLOCALMACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8.0_xxx\JavaHome.
- Java Control Panel- Java tab - View - Path
- Environment Variables - Path ($env:Path) All 3 have to align (if you have multiple entires just remove the wrong ones) - thats all
In case a virus scanner (like McAfee) is running, try:
- Disable virus scanner
- Uninstall Java (via Control Panel / Programs and Features)
- Reinstall Java (from Java.com)
- Re-enable virus scanner
Javac was on 13 from jdk but java was using 1.8 from jre so java threw incompatible runtime error.
- Under Control Panel -> Programs: Uninstall 1.8 (named Java 8 runtime) and DID NOT touch the other one (named Java (TM) SE Development Kit 13).
-
Deleted java.exe, javac.exe and javawc.exe files from:
- C:\Windows\system32
- C:\Windows\SysWOW64
- C:\ProgramData\Oracle\Java\javapath
- The environment variable JDKHOME was pointing to 13 but JAVAHOME was pointing to 1.8 so i pointed JAVA_HOME to also use 13 which was C:\Program Files\Java\jdk-13.0.1
- There was a Path variable under both User variables and system variables sections. For the one in user variables section, add the string %JDK_HOME% - which translated automatically to the physical path. For the one under system variables, I deleted the path C:\ProgramData\Oracle\Java\javapath and added C:\Program Files\Java\jdk-13.0.1\bin