Java Error opening registry key 'Software\JavaSoft\Java Runtime Environment'

元气小坏坏 提交于 2021-02-10 16:43:48

问题


When running "java -version" on command prompt Windows 7, i get this:

Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.

I have already checked environment variables:

JAVA_HOME = C:\Program Files\Java\jdk1.8.0_212\bin

And PATH includes "%JAVA_HOME%

I have also tried deleting files : java.exe, javaw.exe and javaws.exe in ProgramData\Oracle\JAVA\Javapath However, they won't delete. Even though I am an administrator.

I have also checked C:\Windows\System32 and C:\Windows\SYSWOW64 and didnt find java.exe, javaw.exe or javaws.exe to delete.

What else can I try?


回答1:


  1. Do you have multiple Java installed?
  2. What is there in registry key? Does the version specified in the registry key match with your JDK/JRE folder name? Use regedit command to open the registry and look for the key you mentioned in your question (HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment\CurrentVersion). Cleanup/correct the version if you see a discrepancy.
  3. JAVA_HOME should be the path excluding bin and PATH should include bin as %JAVA_HOME%\bin
  4. Are there duplicate entries in PATH and also duplication between user and system environment variables?
  5. Can you directly go (cd) to JDK/JRE bin directory where java executable is present and run java -version?
  6. Lastly, I hope you looked at C:\Windows\System32 and C:\Windows\SYSWOW64 directories and removed java.exe and related files.


来源:https://stackoverflow.com/questions/57244959/java-error-opening-registry-key-software-javasoft-java-runtime-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!