我正在尝试让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。


当前回答

我也有同样的问题。对我来说,解决这个问题的简单方法是将JRE和eclipse同时安装为x86或x64。当他们的位类型不匹配时,eclipse找不到它。所以,如果这不是一个大问题,你卸载和重新安装,以使他们匹配,我会这样做。

我最终安装了: Java运行时环境1.7.0.3(64位)和 Eclipse Indigo(3.7)(64位)

这样就可以了。

其他回答

设置JAVA_HOME变量和ad JAVA_HOME/bin为环境路径变量。

在eclipse文件夹中创建一个批处理文件,并在其中写入:

eclipse -vm C:\Sun\SDK\jdk\jre\bin\javaw.exe

看到 http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F

64位操作系统—> 64位Java、64位Eclipse 32位操作系统—> 32位Java、32位Eclipse

如果您在64位计算机中使用默认更新更新Java版本(并且您有32位浏览器),Java将安装32位版本。您应该找到64位java版本并安装它。

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。

关于只设置JAVA_HOME的所有其他答案都不完全正确。Eclipse也就是不咨询JAVA_HOME。仔细查看错误消息:

...在当前路径中

它字面上说的是PATH,而不是JAVA_HOME。

右键单击“我的电脑”,选择“属性”(或按Winkey+暂停),进入“高级”页签,单击“环境变量”按钮,在底部的“系统变量”列表中选择“路径”(不,不是“Classpath”),单击“编辑”,将“c:\ Path \to\jdk\bin”添加到值的末尾。

或者,如果没有,也可以添加JAVA_HOME环境变量,并在PATH中使用它。在同一个对话框中单击New并将值为c:\path\的JAVA_HOME添加到\jdk。然后您可以将;%JAVA_HOME%\bin添加到Path设置值的末尾。