无法找到Java SE运行时环境。“在安装Java

时间:2021-11-28 14:10:42

I was trying to set up Eclipse for trying my hand at Android app dev. I downloaded Eclipse and tried to run it... discovered I needed Java JDK. Googled and found JDK 7u40 (jdk-7u40-windows-x64.exe) and installed it. The install seemed to have gone dandy but when I tried to run Eclipse I got an error as well as if I try java version in cmd.

我试图设置Eclipse来尝试我的Android应用程序开发,我下载了Eclipse并尝试运行它…发现我需要Java JDK。google搜索并发现了JDK 7u40 (JDK -7u40-windows-x64.exe)并安装了它。安装似乎很顺利,但是当我尝试运行Eclipse时,我得到了一个错误,就像我在cmd中尝试java版本一样。

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

I went to regedit, HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft and Java Runtime Environment doesn't exist in there. Seems like this is more of a symptom than the root cause of my problems.

我去了regedit, HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft,那里不存在Java运行时环境。看来这更多的是一种症状,而不是问题的根本原因。

My PATH looks like

我看起来像

PATH=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program File
s (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Window
s;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Progra
m Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Window
s Live\Shared;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\AIR\bin;C:
\Program Files (x86)\nodejs\;C:\SDK\Android\tools;C:\SDK\Android\platform-tools;
C:\SDK\ANT\apache-ant-1.9.2\bin;C:\Program Files\Java\jdk1.7.0_40\bin\

%JAVA_HOME% = C:\Program Files\Java\jdk1.7.0_40

% JAVA_HOME % = C:\Program Files\Java\ jdk1.7.0_40

I'm running Windows 7 Pro 64-bit

我正在运行Windows 7 Pro 64位版

I did already read through Error when checking Java version: could not find java.dll and linked materials

在检查Java version:找不到Java时,我已经通读了错误。dll和有关材料

9 个解决方案

#1


11  

Finally found a forum post that outlined what the registry is supposed to look like when not broken.

最后找到了一个论坛的帖子,概述了注册表在不被破坏时应该是什么样子。

  1. Added key HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
  2. 新增按键HKEY_LOCAL_MACHINE\软件\JavaSoft\Java运行时环境
  3. Added String Value CurrentVersion = 1.7
  4. 增加字符串值CurrentVersion = 1.7。
  5. Added key HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7
  6. 新增按键HKEY_LOCAL_MACHINE\软件\JavaSoft\Java运行时环境\1.7
  7. Added String Value JavaHome = C:\Program Files\Java\jre7
  8. 添加字符串值JavaHome = C:\Program Files\Java\jre7

Running cmd java -version and Eclipse now works

运行cmd java -version和Eclipse现在可以工作了

#2


4  

You can tell eclipse which JRE to use in the eclipse.ini. If you've installed bundles that require 1.7 in your IDE you will need a 1.7 JRE to run the IDE itself. add the below lines to eclipse.ini file

您可以告诉eclipse在eclipsee .ini中使用哪个JRE。如果在IDE中安装了需要1.7的包,则需要1.7 JRE来运行IDE本身。将下面的行添加到eclipse。ini文件

-startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
-vm C:\Program Files (x86)\Java\jre7\bin\javaw.exe
.
.
.

启动插件/ org.eclipse.equinox.launcher_1.2.0.v20110502。jar vm C:\Program Files (x86)\Java\jre7\bin\javaw.exe。

#3


2  

You can try reinstall your JDK. I've had this problem because I uninstalled so many java things in my PC. And when I open Eclipse, the error occurred.

您可以尝试重新安装JDK。我遇到了这个问题,因为我在我的电脑上卸载了太多的java程序。当我打开Eclipse时,错误发生了。

#4


1  

A 32 bit eclipse cannot load a 64 bit Java Runtime Environment.

32位eclipse不能加载64位Java运行时环境。

Try again with a 32 bit Java Runtime Environment, or (preferred) upgrade your Eclipse to a 64 bit version.

再次尝试使用32位Java运行时环境,或者(首选)将Eclipse升级到64位版本。

Also, a good idea (from the command line)

还有,一个好主意(来自命令行)

C:> java -version

Which should give you details about your JVM. If it doesn't work, focus on fixing that before fixing Eclipse's use of Java.

这将提供有关JVM的详细信息。如果它不工作,那么在修复Eclipse对Java的使用之前,集中精力修复它。

#5


1  

As most of us suggested to edit the registry, but in case you don't want to, because it's risky or you don't have permissions to do so, you can uninstall all the java version, restart your machine, install desired java version, make sure to set path settings. This worked for me.

正如我们大多数人建议编辑注册表,但是如果您不想编辑注册表,因为这样做有风险或者您没有权限,您可以卸载所有java版本,重新启动计算机,安装所需的java版本,确保设置路径设置。这为我工作。

#6


0  

I was getting the same error (below) for Oracle when I clicked on a G2 application.

当我单击G2应用程序时,我得到了与Oracle相同的错误(如下)。

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

错误:打开注册表键“软件\Java运行时环境”

Error: could not find java.dll

错误:无法找到java.dll。

Error: Could not find Java SE Runtime Environment.

错误:找不到Java SE运行时环境。

I restarted the machine, still the same.

我重启了机器,仍然是一样的。

I reinstalled the app (which includes Oracle), still the same.

我重新安装了应用程序(包括Oracle),仍然是一样的。

I checked all the suggested registry settings as suggested and my registry was fine.

我按照建议检查了所有注册表设置,注册表没问题。

I checked the shortcut path and it fires up javaw.exe with a string following within the shortcut. I navigated to the G2 program files and I tried clicking in the javaw.exe directly within the application folder and got the same error.

我检查了快捷路径,它触发了javaw。在快捷方式中使用字符串。我导航到G2程序文件,并尝试单击javaw。exe直接在应用程序文件夹中,得到相同的错误。

I did some research into this and found that Java has a Javaw.exe within the following path:

我做了一些研究,发现Java有一个Javaw。以下路径内的exe:

C:\Program Files\Java\jre7\bin\javaw.exe

C:\Program Files\Java\jre7\bin\javaw.exe

I navigated to the path and clicked on this javaw.exe file and didn't get any errors

我导航到路径并单击这个javaw。exe文件,没有任何错误

I renamed the javaw.exe in the G2 app to javaw_old.exe and then copied and pasted the javaw.exe file from the above path into my app folder. Files side by side, you could see a file size difference and the date was 8 months difference. The newer and larger file being the one in the latest Java install folder.

我改名为javaw。在G2应用中的exe到javaw_old。然后复制粘贴javaw。exe文件从上面的路径进入我的应用文件夹。文件并排,你可以看到文件大小的差异和日期是8个月的差异。更新更大的文件是最新的Java安装文件夹中的文件。

Clicked on the G2 shortcut and the application opened without any errors.

单击G2快捷方式,应用程序打开时没有任何错误。

If you have the same issue as me where everything Java is okay and your still getting the error, try find the java(.exe) file that your app is erroring on, rename it and copy and paste the same file from your Java folder (C:\Program Files\Java\jre7\bin) to the same folder your app's Java file is located.

如果你有和我同样的问题,Java的一切都好,你仍然得到错误,试着找到你的应用程序的Java文件(. exe)是错误,重命名,复制粘贴同样的文件从您的Java文件夹(C:\ Program Files \ Java \ jre7 \ bin)到同一文件夹位于应用程序的Java文件。

I hope this helps someone.

我希望这能帮助某人。

#7


0  

Just reinstall your JRE. You will probably need to restart a computer after uninstalling.

只是重新安装你的JRE。卸载之后,您可能需要重新启动计算机。

#8


0  

Having both 1.7 and 1.8 caused me this problem. While uninstalling 1.8 some of the 1.7 registry keys were removed I guess. I was missing the key Java Runtime Environment and JavaHome String. Uninstalling all the versions of JDK and reinstalling the 1.7(update 80) solved me the problem.

1.7和1.8都给我带来了这个问题。在卸载1.8时,我猜1.7中的一些注册表项被删除了。我错过了关键的Java运行时环境和JavaHome字符串。卸载JDK的所有版本并重新安装1.7(更新80)解决了我的问题。

#9


0  

I had exactly the same problem and exactly same set of errors. That was because my registry key Java Runtime Environment was missing altogether. I did not have any conflicting 32/64 bit settings or any conflicting 1.7/1.8 settings.

我有完全相同的问题和一组完全相同的错误。那是因为我的注册表键Java运行时环境完全丢失了。我没有任何冲突的32/64位设置或任何冲突的1.7/1.8位设置。

All I did was install an update provided by Java and my settings went haywire. What I did to resolve was, instead of updating registry entries myself, I simply did an uninstall and fresh install of JRE and everything was back to normal.

我所做的就是安装Java提供的更新,我的设置变得混乱。我所做的是,我没有自己更新注册表项,而是简单地卸载和重新安装JRE,一切都恢复正常。

#1


11  

Finally found a forum post that outlined what the registry is supposed to look like when not broken.

最后找到了一个论坛的帖子,概述了注册表在不被破坏时应该是什么样子。

  1. Added key HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
  2. 新增按键HKEY_LOCAL_MACHINE\软件\JavaSoft\Java运行时环境
  3. Added String Value CurrentVersion = 1.7
  4. 增加字符串值CurrentVersion = 1.7。
  5. Added key HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.7
  6. 新增按键HKEY_LOCAL_MACHINE\软件\JavaSoft\Java运行时环境\1.7
  7. Added String Value JavaHome = C:\Program Files\Java\jre7
  8. 添加字符串值JavaHome = C:\Program Files\Java\jre7

Running cmd java -version and Eclipse now works

运行cmd java -version和Eclipse现在可以工作了

#2


4  

You can tell eclipse which JRE to use in the eclipse.ini. If you've installed bundles that require 1.7 in your IDE you will need a 1.7 JRE to run the IDE itself. add the below lines to eclipse.ini file

您可以告诉eclipse在eclipsee .ini中使用哪个JRE。如果在IDE中安装了需要1.7的包,则需要1.7 JRE来运行IDE本身。将下面的行添加到eclipse。ini文件

-startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
-vm C:\Program Files (x86)\Java\jre7\bin\javaw.exe
.
.
.

启动插件/ org.eclipse.equinox.launcher_1.2.0.v20110502。jar vm C:\Program Files (x86)\Java\jre7\bin\javaw.exe。

#3


2  

You can try reinstall your JDK. I've had this problem because I uninstalled so many java things in my PC. And when I open Eclipse, the error occurred.

您可以尝试重新安装JDK。我遇到了这个问题,因为我在我的电脑上卸载了太多的java程序。当我打开Eclipse时,错误发生了。

#4


1  

A 32 bit eclipse cannot load a 64 bit Java Runtime Environment.

32位eclipse不能加载64位Java运行时环境。

Try again with a 32 bit Java Runtime Environment, or (preferred) upgrade your Eclipse to a 64 bit version.

再次尝试使用32位Java运行时环境,或者(首选)将Eclipse升级到64位版本。

Also, a good idea (from the command line)

还有,一个好主意(来自命令行)

C:> java -version

Which should give you details about your JVM. If it doesn't work, focus on fixing that before fixing Eclipse's use of Java.

这将提供有关JVM的详细信息。如果它不工作,那么在修复Eclipse对Java的使用之前,集中精力修复它。

#5


1  

As most of us suggested to edit the registry, but in case you don't want to, because it's risky or you don't have permissions to do so, you can uninstall all the java version, restart your machine, install desired java version, make sure to set path settings. This worked for me.

正如我们大多数人建议编辑注册表,但是如果您不想编辑注册表,因为这样做有风险或者您没有权限,您可以卸载所有java版本,重新启动计算机,安装所需的java版本,确保设置路径设置。这为我工作。

#6


0  

I was getting the same error (below) for Oracle when I clicked on a G2 application.

当我单击G2应用程序时,我得到了与Oracle相同的错误(如下)。

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

错误:打开注册表键“软件\Java运行时环境”

Error: could not find java.dll

错误:无法找到java.dll。

Error: Could not find Java SE Runtime Environment.

错误:找不到Java SE运行时环境。

I restarted the machine, still the same.

我重启了机器,仍然是一样的。

I reinstalled the app (which includes Oracle), still the same.

我重新安装了应用程序(包括Oracle),仍然是一样的。

I checked all the suggested registry settings as suggested and my registry was fine.

我按照建议检查了所有注册表设置,注册表没问题。

I checked the shortcut path and it fires up javaw.exe with a string following within the shortcut. I navigated to the G2 program files and I tried clicking in the javaw.exe directly within the application folder and got the same error.

我检查了快捷路径,它触发了javaw。在快捷方式中使用字符串。我导航到G2程序文件,并尝试单击javaw。exe直接在应用程序文件夹中,得到相同的错误。

I did some research into this and found that Java has a Javaw.exe within the following path:

我做了一些研究,发现Java有一个Javaw。以下路径内的exe:

C:\Program Files\Java\jre7\bin\javaw.exe

C:\Program Files\Java\jre7\bin\javaw.exe

I navigated to the path and clicked on this javaw.exe file and didn't get any errors

我导航到路径并单击这个javaw。exe文件,没有任何错误

I renamed the javaw.exe in the G2 app to javaw_old.exe and then copied and pasted the javaw.exe file from the above path into my app folder. Files side by side, you could see a file size difference and the date was 8 months difference. The newer and larger file being the one in the latest Java install folder.

我改名为javaw。在G2应用中的exe到javaw_old。然后复制粘贴javaw。exe文件从上面的路径进入我的应用文件夹。文件并排,你可以看到文件大小的差异和日期是8个月的差异。更新更大的文件是最新的Java安装文件夹中的文件。

Clicked on the G2 shortcut and the application opened without any errors.

单击G2快捷方式,应用程序打开时没有任何错误。

If you have the same issue as me where everything Java is okay and your still getting the error, try find the java(.exe) file that your app is erroring on, rename it and copy and paste the same file from your Java folder (C:\Program Files\Java\jre7\bin) to the same folder your app's Java file is located.

如果你有和我同样的问题,Java的一切都好,你仍然得到错误,试着找到你的应用程序的Java文件(. exe)是错误,重命名,复制粘贴同样的文件从您的Java文件夹(C:\ Program Files \ Java \ jre7 \ bin)到同一文件夹位于应用程序的Java文件。

I hope this helps someone.

我希望这能帮助某人。

#7


0  

Just reinstall your JRE. You will probably need to restart a computer after uninstalling.

只是重新安装你的JRE。卸载之后,您可能需要重新启动计算机。

#8


0  

Having both 1.7 and 1.8 caused me this problem. While uninstalling 1.8 some of the 1.7 registry keys were removed I guess. I was missing the key Java Runtime Environment and JavaHome String. Uninstalling all the versions of JDK and reinstalling the 1.7(update 80) solved me the problem.

1.7和1.8都给我带来了这个问题。在卸载1.8时,我猜1.7中的一些注册表项被删除了。我错过了关键的Java运行时环境和JavaHome字符串。卸载JDK的所有版本并重新安装1.7(更新80)解决了我的问题。

#9


0  

I had exactly the same problem and exactly same set of errors. That was because my registry key Java Runtime Environment was missing altogether. I did not have any conflicting 32/64 bit settings or any conflicting 1.7/1.8 settings.

我有完全相同的问题和一组完全相同的错误。那是因为我的注册表键Java运行时环境完全丢失了。我没有任何冲突的32/64位设置或任何冲突的1.7/1.8位设置。

All I did was install an update provided by Java and my settings went haywire. What I did to resolve was, instead of updating registry entries myself, I simply did an uninstall and fresh install of JRE and everything was back to normal.

我所做的就是安装Java提供的更新,我的设置变得混乱。我所做的是,我没有自己更新注册表项,而是简单地卸载和重新安装JRE,一切都恢复正常。