I installed jdk1.8.0_25 putting the install files in the D: (the C: is nearly full) on Windows 7. I then set my JAVA_HOME environment variable.
On the C: and D: the javac command is found and appears to run correctly. On the D: the java command is found and appears to run correctly.
On the C: java is not found and I get the following error: Error: opening registry key 'Software\\JavaSoft\\Java Runtime Environment' Error: could not find java.dll Error: Could not find Java SE Runtime Environment
I looked in the Registry and found the 'Software\\JavaSoft\\Java Runtime Environment' is missing. I worked around this by removing java.exe and javaw.exe from the C:\\windows\\System32 directory.
Now the java command appears to run correctly on both the C: and D: however I am concerned that the registry entry 'Software\\JavaSoft\\Java Runtime Environment' is still missing.
Can I manually add this to the registry? Do I need to add this to the registry? Will not having this registry entry cause problems?
I just fixed this problem on my pc.
Save this to "java-env.reg":
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft]
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit]
"CurrentVersion"="1.8"
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.8]
"JavaHome"="C:\\Program Files\\Java\\jdk8"
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.8"
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8]
"JavaHome"="C:\\Program Files\\Java\\jdk8\\jre"
"RuntimeLib"="C:\\Program Files\\Java\\jdk8\\jre\\bin\\client\\jvm.dll"
Change version info to your version, and change pathes to your own path.
Execute the regfile.
Hopes this help you.
PS: Someone says just reinstall your jdk&jre will fix it, but I didn't have a try.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.