当我在Windows 7上启动Eclipse Helios时,我得到了这个错误消息:

日志含义创建Java虚拟机失败

我的eclipse.ini看起来如下所示:

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
-vm
P:\Programs\jdk1.6\bin
--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设置正确。我该如何解决这个问题?

到目前为止我尝试过的事情:

将完整路径添加到javaw.exe 虚拟机 P: \程序\ jdk1.6 \ bin \ \ bin \ javaw.exe 完全删除-vm选项 删除——发射器。XXMaxPermSize修复了这个问题,但是它会导致permgen错误 删除——launcher的512值。XXMaxPermSize修复了这个问题,但是它会导致permgen错误 减少-Xmx到512m也解决了这个问题。

为什么我不能使用'1024m'为'-Xmx'和'——launcher.XXMaxPermSize'?


当前回答

从eclipse文件夹中打开eclipse.ini文件。 它有一些附加配置。找到line -launcher.XXMaxPermSize。现在删除默认值256m并保存它。

其他回答

MacOSX和Homebrew用户:

假设您通过homebrew安装了Eclipse: brew install——cask Eclipse -java.rb 然后它可能找不到您的Java SDK,所以打开~/.homebrew/Caskroom/eclipse-java中的eclipse.ini文件

并在vmargs上面的eclipse.ini中添加以下行:

-vm / Library / Java / JavaVirtualMachines amazon-corretto-8 jdk /地点/ Home / bin。

我所要做的就是从eclipse.ini文件中删除-vm并返回。这一次,它会告诉你它在哪里寻找javaw.exe,这样你就可以去那里删除符号链接。确保将JAVA_HOME定义为jdk路径。

在我的例子中,这个问题发生在将Java从1.6更新到1.7之后。

要了解错误,请运行eclipse.exe文件夹下的java.exe。使用eclipse.ini中的参数,因为它将显示导致失败的参数。

例如:

F:\Mobile Class\adt-bundle-windows-x86\adt-bundle-windows-x86\eclipse>java -star
tup plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar --launcher.lib
rary plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813
 -product com.android.ide.eclipse.adt.package.product --launcher.XXMaxPermSize 7
68m  -showsplash org.eclipse.platform --launcher.XXMaxPermSize 768m --launcher.d
efaultAction openFile -vm C:\Program Files\Java\jre7\bin\client\jvm.dll -vmargs
-Dosgi.requiredJavaVersion=1.6 -Declipse.buildId=v21.1.0-569685 -Xms40m -Xmx768m

Unrecognized option: -startup
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

所以我把'startup' swith改为'jar',如下所示,问题解决了:

F:\Mobile Class\adt-bundle-windows-x86\adt-bundle-windows-x86\eclipse>java -jar
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar --launcher.library
 plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813 -pr
oduct com.android.ide.eclipse.adt.package.product --launcher.XXMaxPermSize 768m
-showsplash org.eclipse.platform --launcher.XXMaxPermSize 768m --launcher.defaul
tAction openFile -vm C:\Program Files\Java\jre7\bin\client\jvm.dll -vmargs -Dosg
i.requiredJavaVersion=1.6 -Declipse.buildId=v21.1.0-569685 -Xms40m -Xmx768m

1. 从eclipse文件夹中打开eclipse.ini文件,见下图。

2. 在记事本或任何其他文本编辑器应用程序中打开eclipse.ini,找到行-Xmx256m(或-Xmx1024m)。现在将默认值256m(或1024m)更改为512m。您还需要给出确切的java安装版本(1.6或1.7或其他)。

是这样的:

-Xmx512m
-Dosgi.requiredJavaVersion=1.6

OR

-Xmx512m
-Dosgi.requiredJavaVersion=1.7

OR

-Xmx512m
-Dosgi.requiredJavaVersion=1.8

那它对我很有效。

我找到了一个非常简单的解决方法。只需删除eclipse.ini文件,但先备份。我有同样的问题很多次,最后我删除了这一点,我不再有这个问题。

它还增加了加载时间。现在我的Eclipse启动速度比以前快。