Java Error opening registry key
I get this error when I try to do anything with Java in command prompt:
Error opening registry key 'Software\JavaSoft\Java Runtime Environment.3'
Error: could not find Java.dll
Error: could not find Java 2 Runtime Environment
I did screw around with deleting Java directories and registry a few days ago. I restarted computer and java was still working fine, then i restarted it again today and now I get this error. I have tried uninstalling and reinstalling but that doesn't seem to work. I have the latest java JRE installed and the path set in the environment variables. Anyone have any clue how to fix this?
Make sure you remove any java.exe
, javaw.exe
and javaws.exe
from your Windows\System32
folder and if you have an x64 system (Win 7 64 bits) also do the same under Windows\SysWOW64
.
If you can't find them at these locations, try deleting them from C:\ProgramData\Oracle\Java\javapath
.
You will find a folder named "Oracle" on ProgramData folder in your windows installed drive. Remove the folder. Hope it will work. In my case my install drive is C and my path is C:\ProgramData\Oracle
I had a similar problem. I had installed JDK7 update 1 but couldn't use it (probably because I found a JRE6 that I deleted after installing JDK7). Uninstalling JDK7 was impossible. The solution was to add the JRE registry entries by hand.
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.7"
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7]
"JavaHome"="C:\\Program Files\\Java\\jre7"
"RuntimeLib"="C:\\Program Files\\Java\\jre7\\bin\\client\\jvm.dll"
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_01]
"JavaHome"="C:\\Program Files\\Java\\jre7"
"RuntimeLib"="C:\\Program Files\\Java\\jre7\\bin\\client\\jvm.dll"
You'll have to adjust the above to your own directories and version.
If this doesn't help, there's still JavaRa https://singularlabs.com/software/javara/ .
Delete these 3 files present in your local at path C:\ProgramData\Oracle\Java\javapath
java.exe
javaw.exe
javaws.exe
This solved the issue for me :)