我在 Windows 7 上下载了最新的 Eclipse。当我单击 Eclipse 图标时,它抛出以下异常:
我已经安装了 JRE 和 JDK。
更新:Eclipse.ini 内容:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m
-vm C:\Program Files (x86)\Java\jre7\bin
最佳答案
根据 Eclipse 文档,您可能需要在 VM 参数之前指定 VM,并且路径不应与 -vm 开关在同一行:
- The -vm option and its value (the path) must be on separate lines.
- The value must be the full absolute or relative 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.
例如:
-vm
C:\Java\JDK\1.6\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx1024m
您可能还需要用引号将您的路径括起来,因为它包含空格。我总是将诸如 Eclipse 和 Java 之类的东西安装在没有空格的根目录中,而不是在 Program Files
下,以避免出现此问题。
关于java - 在 Windows 7 上运行 Eclipse 找不到 JRE 和 JDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16717119/