当我在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.ini文件。先试试。如果这种方法不能解决您的问题,请尝试下面描述的解决方案。

其他解决方法:

解决方案1

在eclipse.ini文件中添加一个字符串,该字符串将更改javaw.exe文件的目标。主要的事情是这个字符串必须放在字符串"-vmargs"之上!

-vm
C:\Program Files\Java\jdk1.6.0_22\bin\javaw.exe 

解决方案2

删除-launcher的值。XXMaxPermSize,比如256m。

解决方案3

删除或减少Xms和Xmx的值:

-Xms384m 
-Xmx384m

其他回答

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

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

那它对我很有效。

在上述经过验证的步骤失败后,我决定重新安装后尝试了一些东西。

添加:%\USER PATH\Java\jdk1.6.0_39\bin到环境变量

删除:eclipse配置文件

重新运行:eclipse .exe

现在项目的一切都恢复正常了。

正确的解决方法是在文件夹中添加指向Java文件夹jvm.dll文件的-vm行。

-vm
C:\Program Files\Java\jre1.8.0_202\bin\server\jvm.dll
/*there is no dquote for path, and path points to right java version folder mentioned in ini file*/

If the above fix is not fruitful, then do not attempt anything else. Most of the advice in this thread is misguided. Some of these hacks might work temporarily or on certain machine configurations, but the contents of eclipse.ini are not trivial nor arbitrary. For the authoritative reference, see this [wiki page]:https://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM that explains the contents of the file. Also note the See Also links at the bottom of that page for more details about things like heap size, etc. DO NOT delete eclipse.ini, EVER. It is also inadvisable to remove the -vm or Xmx options. If you do, you're asking for trouble.

以下是wiki页面上与您的问题相关的参考资料:

试着添加

-vm
D:\Java\jdk1.6.0_29\bin\javaw.exe

供参考:参考太阳博客

对于其他可能对Java 7有问题的人,请参考Eclipse Wiki - Eclipse .ini vm_value (windows示例)

这可能不适用于所有系统。如果在启动eclipse时遇到“Java已启动但返回退出代码=1”错误,请修改-vm参数以指向jvm.dll

e.g.

-vm
C:\Program Files\Java\jre7\bin\client\jvm.dll

还要注意

-vm选项必须出现在-vmargs选项之前,因为-vmargs之后的所有内容都将直接传递给JVM