[英]Java Error opening registry key 'Software\JavaSoft\Java Runtime Environment'
When running "java -version" on command prompt Windows 7, i get this:在命令提示符 Windows 7 上运行“java -version”时,我得到这个:
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%
并且
PATH
包括"%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.我也尝试过在
ProgramData\Oracle\JAVA\Javapath
中删除文件:java.exe、javaw.exe 和 javaws.exe 但是,它们不会删除。 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.我还检查了
C:\Windows\System32
和C:\Windows\SYSWOW64
并没有找到要删除的 java.exe、javaw.exe 或 javaws.exe。
What else can I try?我还能尝试什么?
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
).regedit
命令打开注册表并查找您在问题中提到的密钥( HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment\CurrentVersion
)。 Cleanup/correct the version if you see a discrepancy.JAVA_HOME
should be the path excluding bin
and PATH
should include bin as %JAVA_HOME%\bin
JAVA_HOME
应该是不包括bin
的路径, PATH
应该包括 bin 作为%JAVA_HOME%\bin
PATH
and also duplication between user and system environment variables? PATH
中是否存在重复条目以及用户和系统环境变量之间是否存在重复?java -version
?java -version
吗?C:\Windows\System32
and C:\Windows\SYSWOW64
directories and removed java.exe and related files.C:\Windows\System32
和C:\Windows\SYSWOW64
目录并删除 java.exe 和相关文件。This error also comes when the software you are using is of 32-bit and you have a 64-bit version of Java installed which is not compatible with the existing softwares where you want to work.当您使用的软件是 32 位并且您安装了与您想要工作的现有软件不兼容的 64 位版本的 Java 时,也会出现此错误。 You may also uninstall 64-bit and install the 32-bit version which will resolve the issue.
您也可以卸载 64 位并安装将解决问题的 32 位版本。
This happened to me when I uninstalled and old Oracle version of Java.当我卸载旧的 Oracle 版本的 Java 时,这发生在我身上。 The registry key was deleted but a Java executable remained in a hidden folder.
注册表项已删除,但 Java 可执行文件仍保留在隐藏文件夹中。 For proper cleanup
进行适当的清理
(on Windows): (在 Windows 上):
where java
will reveal the location of the shortcut, eg, C:\ProgramData\Oracle\Java\javapath\java.exe
(notice that this is a hidden folder). where java
将显示快捷方式的位置,例如C:\ProgramData\Oracle\Java\javapath\java.exe
(注意这是一个隐藏文件夹)。
Assuming you wanted to get rid of the old Java version, you can delete this folder, and the corresponding path entry.假设你想摆脱旧的 Java 版本,你可以删除这个文件夹,以及相应的路径条目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.