我正在尝试让 Eclipse v3.5 (Galileo) 在我的计算机上重新运行 - 我之前运行过它没有任何问题,但现在我不断收到此错误:
A Java Runtime Environment (JRE) or Java Development kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations: C:\eclipse\jre\javaw.exe javaw.exe in your current PATH
我刚刚完成了 JDK 和 SDK 的全新安装。
我有 Windows 7 (x64)。
这是怎么回事?我该如何解决?
我无法运行任何 ipconfig/tracert/或 ping。
最佳答案
Eclipse 默认会尝试使用默认的“java.exe
”(PATH
引用的第一个)
要记住的三件事:
- “安装”一个 JRE or a JDK 可以像从另一台计算机解压缩或复制它一样简单:没有特殊的安装步骤,您可以拥有任意多个不同的 JVM 版本(1.4、5.0、6.0...) , “安装”(复制)几乎在您磁盘上的任何位置。
- 我建议始终使用最新的 JRE 运行 Eclipse(以从 latest hotspot 演变中受益)。
你可以:
- 在 eclipse.ini 中引用确切的 JRE 路径。
- Copy any JRE of your in your <eclipse>/jre 目录。
在这两种情况下,都没有要更新的
PATH
。
- 您将在 Eclipse session 中引用的 JVM 不 总是用于启动 Eclipse,因为:
- 你只需要一个 JRE 来启动 Eclipse,但是一旦 Eclipse 启动,你应该为你的项目注册一个 JDK(特别是用于 Java 源代码和调试目的,理论上也用于编译,但 Eclipse 有自己的 Java 编译器) 注意:您可以在 Eclipse 中只注册一个 JRE,因为它足以运行您的程序,但 JDK 将允许更多操作。
- 即使在 Eclipse 中默认注册的 Java 是用于启动 session 的 Java,您也可能希望注册一个较旧的 SDK(包括非 Sun SDK),以便使用类似于一种将实际用于生产的产品。
2012 年 6 月,jmbertucci 评论:
I'm running Windows 7 64-bit and I had the 32-bit JRE installed. I downloaded Eclipse 64-bit which looks for a 64-bit JRE. Because I didn't have the 64-bit JRE it threw the error, which makes sense.
I went to the Java manual install page (which was not as directly accessible as you'd like) and installed the 64-bit version. See "Java Downloads for All Operating Systems". That was all I needed.
2016 年 4 月:Steve Mayne 添加了 in the comments:
I had to edit the
eclipse.ini
file to reference the correct Java path - Eclipse doesn't use the environmentPATH
at all when there is a value ineclipse.ini
.
关于Eclipse - 没有 Java (JRE)/(JDK) ...没有虚拟机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2030434/