Eclipse在我的Windows 7系统上无法启动,提示JRE未找到错误。

3
当我启动eclipse时,立即出现以下错误:

必须安装Java Runtime Environment(JRE)或Java Development Kit(JDK)才能运行Eclipse。在搜索以下位置后未找到任何Java虚拟机:C:\Program Files\eclipse\jre\bin\javaw.exe javaw.exe在您当前的PATH中

看起来它无法读取ini文件,或者实际的java路径系统变量。
根据我在网上阅读的内容,我创建了一个包含以下内容的eclipse.ini文件:
-vm
c:\program files\java\jre7\bin\javaw.exe

这应该可以避免在路径上胡乱操作。

我正在运行Windows 7,sp1。

欢迎任何想法和评论!

祝好,

史蒂夫·奥沙利文

3个回答

9
创建一个环境变量PATH,将其值设置为您的jdk bin文件夹的路径。

1
太好了!谢谢。我是微软的新员工,正在从Macintosh转换到Windows(又一次……)。 - Sosullivan

5

虽然PATH变量可以使用,但最佳实践是将它放在eclipse.ini文件中,这样可以让您快速更改正在使用的JRE版本。话虽如此,当涉及到eclipse.ini文件的位置和语法时,存在一些奇怪的问题。

 - The -vm option and its value (the path) must be on separate lines.
 - The value must be the full absolute path to the Java executable, not just to the Java home directory.
 - The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.

希望这能有所帮助。

2
尝试将路径放在引号中,例如:"c:\program files\java\jre7\bin\javaw"

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接