Eclipse 错误:“无法创建 Java 虚拟机"
我在 Windows 7 上启动 Eclipse Helios 时收到此错误消息:
I am getting this error message when I start Eclipse Helios on Windows 7:
未能创建 Java 虚拟机
Failed to create the Java Virtual Machine
我的 eclipse.ini 如下所示:
My eclipse.ini looks as follows:
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
-vm
P:Programsjdk1.6in
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms120m
-Xmn100m
-Xmx1024m
据我所知,我的 JAVA_HOME 设置正确.我该如何解决这个问题?
My JAVA_HOME is correctly set as far as I can tell. How can I fix this?
- 添加 javaw.exe 的完整路径-vmP:Programsjdk1.6in\binjavaw.exe
- 完全删除
-vm
选项 - 删除
--launcher.XXMaxPermSize
修复了该问题,但会导致 permgen 错误 - 删除
--launcher.XXMaxPermSize
的值512
修复了问题,但会导致 permgen 错误 - 将
-Xmx
减少到512m
也解决了这个问题.
- Adding the full path to javaw.exe
-vm P:Programsjdk1.6in\binjavaw.exe
- Removing the
-vm
option altogether - Removing
--launcher.XXMaxPermSize
fixes the issue, but it causes permgen errors - Removing the value
512
of--launcher.XXMaxPermSize
fixes the issue, but it causes permgen errors - Reducing
-Xmx
to512m
also fixes the issue.
为什么我不能将1024m"用于-Xmx"和--launcher.XXMaxPermSize"?
Why can I not use '1024m' for '-Xmx' and '--launcher.XXMaxPermSize'?
1. 打开 eclipse 文件夹中的 eclipse.ini
文件,见下图.
1. Open the eclipse.ini
file from your eclipse folder,see the picture below.
2. 在 Notepad
或任何其他 text-editor
应用程序中打开 eclipse.ini
,找到该行-Xmx256m
(或 -Xmx1024m
).现在将默认值 256m
(或 1024m
)更改为 512m
.您还需要提供确切的 java 安装版本(1.6 或 1.7 或其他).
2. Open eclipse.ini
in Notepad
or any other text-editor
application, Find the line -Xmx256m
(or -Xmx1024m
). Now change the default value 256m
(or 1024m
) to 512m
. You also need to give the exact java installed version (1.6 or 1.7 or other).
像这样:
-Xmx512m
-Dosgi.requiredJavaVersion=1.6
或
-Xmx512m
-Dosgi.requiredJavaVersion=1.7
或
-Xmx512m
-Dosgi.requiredJavaVersion=1.8
那么它对我来说效果很好.
Then it works well for me.