java 11 error: opening registry key 'software\javasoft\java runtime environment'
I started a training program on LinkedIn on 2/5/19. It required me to install the new Java JDK 11.0.2 version. After installing the new Java JDK 11 it wasn’t showing up in MS DOS. When I typed in java version it would show the old java 10 version. I fixed that problem by removing all old versions.
(1) uninstall all Java versions, (2) run "java -version" to make sure you really removed all, (3) reboot, Windows needs this to reset some system variables, (4) reinstall the Java version(s) you intend to use (5) reboot once more, in case Java installation changed the system variables once more.
Thanks:Error opening registry key ‘Software\JavaSoft\JRE’ while installing elki
However, a new problem started. I received an error message:
Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
I checked my path in Control Panel\All Control Panel Items\System\
Advanced system settings > Advanced > Environment Variables
Set PATH and JAVA HOME with: C:\Program Files\Java\jdk-11.0.2\bin
Edit System Variable
New
C:\Program Files\Java\jdk-11.0.2\bin;C:\Program Files (x86)\HP SimplePass\x64;C:\Program Files (x86)\HP SimplePass\;……
remove all others
Still was having the problem until I did this:
FIXED ISSUE:
Windows > Start > cmd >
I used this first one:
C:> for %i in (javac.exe) do @echo. %~$PATH:i
or
C:> where java
It return 'C:\ProgramData\Oracle\Java\javapath' folder which contain:
MUST REMOVE:
java.exe
javaw.exe
javaws.exe
Browse to this folder with Windows file explorer and remove everything (three files above).
Close and reopen cmd (Windows > Start > cmd >)
C:> java -version
Should now return:
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
or something similar depending on which java release package you've downloaded...
It works!
https://superuser.com/questions/1382158/on-windows-why-java-version-return-error-opening-registry-key-software-javas
Thank you to these guys that help me with this issue!! Wanted to share this with others so they wouldn't spend hours trying to fix this issue!