This is error due to multiple java version installed at different location.
so in my case this is output .
so i removed the all files from 'C:\ProgramData\Oracle\Java\javapath
also deleted java folder from this location c:\java\jdk1.8.0_131\bin
and worked.
How to make it work:
Step 1: Open terminal and type where 'java'
It return 'C:\ProgramData\Oracle\Java\javapath' folder which contain:
java.exe
javaw.exe
javaws.exe
Browse to this folder with Windows file explorer and remove everything (three files above).
Step 2: now check
C:\Users\Admin>java -version
Should now return:
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
or something similar depending on which java release package you've downloaded...
It works!
There are other links can help
1.
2.
https://stackoverflow.com/questions/6362037/java-error-opening-registry-key
I hope your issue will be resolved .