Eclipse 无法创建 Java 虚拟机

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20317640/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 01:03:06  来源:igfitidea点击:

Eclipse Failed to create the Java Virtual Machine

javaandroideclipse

提问by SamHyman

I'm using eclipse to develop android application and it always gone well, but today it's giving problems.

我正在使用 eclipse 来开发 android 应用程序,而且它总是很顺利,但今天却出现了问题。

When i try to open eclipse it show me this message "Failed to create the java virtual machine. Error occurred during initialization of VM. Could not reserve enough space for object heap"

当我尝试打开 eclipse 时,它​​向我显示此消息 "Failed to create the java virtual machine. Error occurred during initialization of VM. Could not reserve enough space for object heap"

This is my eclipse.ini

这是我的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
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256M
-showsplash
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms1336m 
-Xmx1336m
-Declipse.buildId=v22.3.0-887826
-XX:MaxPermSize=512M

I tried to change "256m"in "512m"but it still doesn't work. I tried to restart but nothing. I tried to change the -XX:MaxPermSize=512Mvalue, but nothing.

我试图改变"256m""512m"但它仍然不起作用。我试图重新启动,但没有。我试图改变-XX:MaxPermSize=512M价值,但没有。

回答by Neeraj Nama

Closed all the other memory intensive application in my windows7. And tried to open eclipse. This worked for me, and I found it on similar question here Stackoverflow-eclipse failed to create JVM.

关闭了我的 windows7 中的所有其他内存密集型应用程序。并尝试打开eclipse。这对我有用,我在类似的问题上找到了它Stackoverflow-eclipse failed to create JVM

回答by Sazzad Hissain Khan

Just add your JDK path in windows environment variable.

只需在 windows 环境变量中添加您的 JDK 路径。

enter image description here

在此处输入图片说明

回答by Secko

Open eclipse.iniand change the following variables.

打开eclipse.ini并更改以下变量。

For -Dosgi.requiredJavaVersion=1.8, try changing your required Java version to 1.6.

对于-Dosgi.requiredJavaVersion=1.8,尝试将所需的 Java 版本更改为1.6

Memory-related defaults (as of Eclipse 3.4):

与内存相关的默认值(从 Eclipse 3.4 开始):

  • -Xms40m
  • -Xmx256m
  • -XX:MaxPermSize=256m
  • -Xms40m
  • -Xmx256m
  • -XX:MaxPermSize=256m

Recommended settings for Android development:

Android 开发的推荐设置:

  • -Xms128m
  • -Xmx512m
  • -XX:MaxPermSize=256m
  • -Xms128m
  • -Xmx512m
  • -XX:MaxPermSize=256m

If everything else fails you can just delete or renameeclipse.iniand let the IDE handle everything. I strongly suggest looking for a current replacement for your eclipse.iniand reading up on how to configure the eclipse.inifor Android development.

如果其他一切都失败了,您可以删除或重命名eclipse.ini并让 IDE 处理所有事情。我强烈建议您寻找当前的替代品,eclipse.ini并阅读有关如何为 Android 开发配置eclipse.ini的信息。