我正在尝试让Eclipse v3.5 (Galileo)在我的计算机上重新运行-我以前运行过,没有问题,但现在我一直得到这个错误:

要运行Eclipse,必须提供Java运行时环境(JRE)或Java开发工具包(JDK)。在搜索以下位置后没有发现Java虚拟机: C: \ eclipse \ jre \ javaw.exe javaw.exe在当前路径

我刚刚重新安装了JDK和SDK。

我用的是Windows 7 (x64)。

这是怎么回事?我该怎么解决呢?

我不能运行任何ipconfig / tracert /或ping。


当前回答

一个问题是eclipse -64位版本和我们的Java安装为32位版本之间的冲突。这个问题不容易解决,因为Java安装页面没有提供64位的选项——它假设是32位,然后下载并安装32位的版本。要解决此问题,请遵循以下步骤:

通过转到Java SE运行时环境7下载64bit版本(此链接为我们提供了下载64bit版本Java的选项)。下载并安装。 现在,尝试安装Eclipse仍然会抛出一个错误。因此,我们从C:/program files/Java/复制jre7文件夹,并将其复制到Eclipse安装文件夹中。 现在,我们将其重命名为jre。

安装Eclipse。

——launcher.appendVmargs 虚拟机 C:\Program Files\Java\ jdk1.7.0_79 \ jre \ bin \ javaw.exe —vmargs

其他回答

不要依赖windows path变量,因为它几乎在每次更新中都会更改。例如,chrome(64位机器上的32位)java更新将全系统64位JVM替换为32位JVM。还要注意的是,这个条目必须是eclipse.ini中的最后一个条目,否则它将不起作用,并且-如前所述- eclipse.exe不会计算JAVA_HOME变量。

即使你的JAVA_HOME和路径配置有效,他们可能有这个问题,所以 最简单的方法是打开eclipse安装文件夹中的eclipse.ini

虚拟机 C:\Program Files\Java\ jdk1.7.0_71 \ bin \ javaw.exe

将C:\Program Files\Java\ jdk1.7.0_71\bin\javaw.exe替换为jdk或jre的路径

Eclipse将在默认情况下尝试使用默认的“java.exe”(由PATH引用的第一个)启动。

要记住三件事:

"Installing" a JRE or a JDK can be as simple as unzipping or copying it from another computer: there is no special installation steps, and you can have as many different JVM versions (1.4, 5.0, 6.0...) as you want, "installed" (copied) almost anywhere on your disk. I would recommend to always run Eclipse with the lastest JRE possible (to benefit from the latest hotspot evolutions). You can: Reference that exact JRE path in your eclipse.ini. Copy any JRE of your in your <eclipse>/jre directory. In both cases, no PATH to update. The JVM you will reference within your Eclipse session is not always the one used for launching Eclipse because: You only need a JRE to launch Eclipse, but once Eclipse launched, you should register a JDK for your projects (especially for Java sources and debugging purposes, also in theory for compilation but Eclipse has its own Java compiler) Note: You could register just a JRE within Eclipse because it is enough to run your program, but again a JDK will allow for more operations. Even though the default registered Java in Eclipse is the one used to launch the session, you can want to register an older SDK (including a non-Sun one) in order to run/debug your programs with a JRE similar to the one which will actually be used in production.


2012年6月,jmbertucci评论道:

我运行的是64位的Windows 7,并且安装了32位的JRE。 我下载了一个64位的Eclipse 64位JRE。 因为我没有64位JRE,所以它抛出了错误,这是有道理的。 我转到Java手动安装页面(不像你想的那样直接访问),安装了64位版本。参见“适用于所有操作系统的Java下载”。 这就是我所需要的。


2016年4月:史蒂夫·梅恩在评论中补充道:

我必须编辑eclipse.ini文件以引用正确的Java路径- 当Eclipse .ini中有值时,Eclipse根本不使用环境PATH。

JDK不会在默认路径下安装JVM。

除非您像ant一样需要外部工具来运行,否则非jdk就足以让Eclipse运行。安装这样的JVM最简单的方法是访问http://java.com,让它安装它想安装的任何东西。

然后再次双击Eclipse二进制文件。

编辑eclipse.ini文件以更新新更新的JDK。以前我有jdk1.7.0_09,现在更新到jdk1.7.0_80, eclipse抛出了这个错误。

要运行Eclipse,必须提供Java运行时环境(JRE)或Java开发工具包(JDK)。没有 找到Java虚拟机后,搜索如下 C:/Program Files/Java/jdk1.7.0_09/bin/javaw

更新eclipse.ini之后,

-vm
C:/Program Files/Java/jdk1.7.0_09/bin/javaw

to

-vm
C:/Program Files/Java/jdk1.7.0_80/bin/javaw

Eclipse工作正常。

如果在环境变量的PATH变量中添加C:\Program Files\Java\ jdk1.8.0_92\bin后,eclipse会给出相同的错误

在eclipse文件夹中找到eclipse配置设置文件,你必须看到与C:\program Files中相同的jdk路径

我希望它能有所帮助。