Eclipse 错误:“无法创建 Java 虚拟机”
当我在 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 的完整路径 <代码>-vm P:\Programs\jdk1.6\bin\\bin\javaw.exe
- 完全删除
-vm
选项 - 删除
--launcher.XXMaxPermSize
修复了该问题,但会导致永久错误 - 删除
--launcher.XXMaxPermSize
的值512
修复了该问题,但会导致永久 - 错误
-Xmx
到512m
也修复了该问题。
为什么我不能将“1024m”用于“-Xmx”和“--launcher.XXMaxPermSize”?
I am getting this error message when I start Eclipse Helios on Windows 7:
Failed to create the Java Virtual Machine
My eclipse.ini looks as follows:
-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
My JAVA_HOME is correctly set as far as I can tell. How can I fix this?
Things I have tried so far:
- Adding the full path to javaw.exe
-vm
P:\Programs\jdk1.6\bin\\bin\javaw.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.
Why can I not use '1024m' for '-Xmx' and '--launcher.XXMaxPermSize'?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(30)
1. 从 eclipse 文件夹中打开
eclipse.ini
文件,如下图所示。2. 在
中打开
或任何其他eclipse.ini
>记事本文本编辑器
应用程序,找到行-Xmx256m
(或-Xmx1024m
)。现在将默认值256m
(或1024m
)更改为512m
。您还需要提供确切的 java 安装版本(1.6 或 1.7 或其他)。像这样:
OR
OR
那么它适用于我。
1. Open the
eclipse.ini
file from your eclipse folder,see the picture below.2. Open
eclipse.ini
inNotepad
or any othertext-editor
application, Find the line-Xmx256m
(or-Xmx1024m
). Now change the default value256m
(or1024m
) to512m
. You also need to give the exact java installed version (1.6 or 1.7 or other).Like This:
OR
OR
Then it works well for me.
尝试添加
仅供参考:请参阅 sunblog
对于其他可能遇到 Java 7 问题的人,按照 Eclipse Wiki - eclipse.ini vm_value(Windows 示例)
例如
另请注意
Try to add
FYI: Refer sunblog
For others who might have problems with Java 7, as per Eclipse Wiki - eclipse.ini vm_value (windows example)
e.g.
Also note that
尝试删除
-vm P:\Programs\jdk1.6\bin
行。另外,一般建议:设置
-Dosgi.requiredJavaVersion=1.6
,而不是1.5
。Try removing the
-vm P:\Programs\jdk1.6\bin
lines.Also, a general recommendation: set
-Dosgi.requiredJavaVersion=1.6
, not1.5
.我知道这现在已经很老了,但我刚刚遇到了同样的问题,问题是我分配了很多内存给 Eclipse,但它无法抓住。因此,打开 eclipse.ini 并降低分配给
-Xmx
的内存量XXMaxPermSize
我将其更改为-Xmx512m
和XXMaxPermSize256m
I know this is pretty old now but I have just had the same issue and the problem was I was allocating to much memory to eclipse that it could not get hold of. So open eclipse.ini and lower the amount of memory that is being allocated to
-Xmx
XXMaxPermSize
I changed mine to-Xmx512m
andXXMaxPermSize256m
我删除了eclipse.ini。我遇到了这个问题并删除 ini 文件解决了它。
I removed eclipse.ini. I encountered this issue and removing the ini file solved it.
从 eclipse 文件夹中打开
eclipse.ini
文件。它有一些附加配置。找到行
–launcher.XXMaxPermSize
。现在删除默认值 256m 并保存它。Open the
eclipse.ini
file from your eclipse folder.It has some of add on configuration . Find the line
–launcher.XXMaxPermSize
. Now remove the the default value 256m and save it.将 -vmargs 替换为 javaw.exe 当前的真实路径:*-vm
“c:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe”*
<块引用>
<前><代码>-启动
插件/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
插件/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813
-产品
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256M
-showsplash
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256米
--launcher.defaultAction
打开文件
**-vm“c:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe”**
-Dosgi.requiredJavaVersion=1.6
-Xms40米
-Xmx768米
-Declipse.buildId=v21.1.0-569685
Replace -vmargs by your current real path of javaw.exe: *-vm
“c:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe”*
我找到了一个非常简单的解决方案。只需删除 eclipse.ini 文件,但先备份。我多次遇到同样的问题,最后我删除了这个,我不再有这个问题了。
它还增加了加载时间。现在我的 Eclipse 启动速度比以前更快了。
I found a very easy solution for this. Just delete
eclipse.ini
file, but backup first. I had this same problem many times and finally I deleted this and I no more have the problem.It also increased loading time. Now my Eclipse starts faster than earlier.
您还可以通过删除“-launcher.XXMaxPermSize”行下的值“256m”来解决此问题。
You can also solve this issue by removing the value "256m" under the line "-launcher.XXMaxPermSize”.
打开位于 eclipse 安装文件夹中的 ecplise.ini 文件。
查找并查找将 -vmargs 行替换为 -vm D:\jdk1.6.0_23\bin\javaw.exe 或仅删除 -vmargs 行并保存。现在问题已经解决了
Open the ecplise.ini file which is located in the eclipse installation folder.
Find & Replace the line -vmargs with -vm D:\jdk1.6.0_23\bin\javaw.exe OR just remove the line -vmargs and save it . Now the problem is getting solved
在
STS.conf
文件中,您需要检查两件重要的事情,以避免创建/分配 jvm 问题1. 给出准确的 jdk 安装位置:
2. > 您需要提供准确的 java 安装版本:
3。 尝试减少内存大小:
In
STS.conf
file you need to check two important things to avoid create/allocate jvm issue1. Give the exact jdk install location:
2. You need to give the exact java installed version:
3. Try to reduce the memory size:
在尝试了上述减少内存的解决方案后,Eclipse 开始工作,但每次从工作空间加载插件时都会挂起,特别是在 org.eclipse.debug.core 处。
我在这里找到了解决方案, Eclipse 挂起在启动屏幕,并希望分享它。希望它也能帮助其他人。
After trying the above solution of reducing the memory, Eclipse starts working but hangs every time while loading the plugins from the work-space specially at
org.eclipse.debug.core
.I found the solution here, Eclipse hangs at Splash Screen, and want share it. Hopefully it can help others as well.
试试这个:
Try this one:
确保 eclipse.ini 在 vmargs 之前没有多个条目并使用了 vm 条目:
Make sure eclipse.ini do not have multiple entry and used vm entry before vmargs:
快速修复:
将 eclipse.ini 中的
-Xmx1024m
更改为-Xmx512m
(文件位于eclipse.exe存在)。它会像魅力一样发挥作用。
Quick fix:
Change
-Xmx1024m
to-Xmx512m
in eclipse.ini (file located at the same level whereeclipse.exe
is present). And it will work like a charm.解决此问题的简单方法就是删除或重命名您的 eclipse.ini 文件。先试试吧。如果此方法无法解决您的问题,请尝试下面描述的解决方案。
其他修复方法:
解决方案 1
将字符串添加到 eclipse.ini 文件中,以更改
javaw.exe
文件的目标。最主要的是这个字符串必须放在字符串“-vmargs”之上!解决方案2
删除
–launcher.XXMaxPermSize
的值,例如256m。解决方案3
删除或减小Xms和Xmx的值:
The simple way to fix this problem is just to delete or rename your eclipse.ini file. Try it first. If this method does not resolve your problem, try the solutions described below.
Other ways to fix it:
Solution 1
Add a string into the eclipse.ini file which change a destination of the
javaw.exe
file. The main thing is that this string must be placed above the string "-vmargs"!Solution 2
Remove the value of
–launcher.XXMaxPermSize
, like 256m.Solution 3
Remove or decrease the values of Xms and Xmx:
这可能有效:
打开 eclipse.ini 文件并将以下行粘贴到行尾。
This may work:
Open
eclipse.ini
file and paste below lines at the end of the lines.在 eclipse.ini 中添加 -vm 后,如下所示对我有用。在
-vmargs
之前添加它,不要删除它有一个 jdk 更新导致了此问题。
After adding -vm in eclipse.ini as shown below worked for me. Add it before
-vmargs
do not remove itThere was a jdk update which was causing this issue.
解决问题的正确方法是在 ini 文件中添加指向 Java 文件夹的 jvm.dll 文件的 -vm 行。
如果上述修复没有效果,则不要尝试其他任何操作。该线程中的大多数建议都是误导的。其中一些 hack 可能会暂时起作用或在某些机器配置上起作用,但 eclipse.ini 的内容并非微不足道或任意的。
有关权威参考,请参阅此 [wiki 页面]:https://wiki.eclipse.org/ Eclipse.ini#Specifying_the_JVM 解释该文件的内容。另请注意该页面底部的“另请参阅”链接,以获取有关堆大小等内容的更多详细信息。
永远不要删除 eclipse.ini。也不建议删除 -vm 或 Xmx 选项。如果你这样做,你就是在自找麻烦。
以下是与您的问题相关的 wiki 页面的引用:
The proper solution to your problem is to add the -vm line pointing to jvm.dll file of your Java folder in ini fie.
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.
Here are references from the wiki page pertaining to your problem:
这对我有用:
我关闭了 Windows 7 计算机上的所有其他内存密集型应用程序。我尝试打开 Eclipse,瞧,它成功了。
This worked for me:
I closed all the other memory intensive applications on my Windows 7 machine. And I tried to open Eclipse, and, voila, it worked.
有时它不是您的 eclipse.ini;是你的JDK崩溃了。您可以通过在命令提示符中编写以下命令来检查:
如果此命令显示以下错误:
那么首先卸载 JDK 并重新安装它。
Eclipse 将再次运行;)今天我遇到了同样的问题,并且
以上是由 Itachi Uchiha 建议的。
Some time it's not your eclipse.ini; it's your JDK which is crashed. You can check it by writing following command in a command prompt:
If this command shows the following error:
Then first uninstall JDK and reinstall it.
Eclipse will be in action again ;) As today I have got the same problem, and
the above is suggested by Itachi Uchiha.
当我的 Eclipse proton 无法启动时遇到问题。
出现错误“无法创建 Java 虚拟机”
在 eclipse.ini 文件中添加了以下内容
Faced the issue when my Eclipse proton could not start.
Got error "Failed to create the Java virtual machine"
Added below to the eclipse.ini file
您需要将
javaw.exe
完整路径添加到eclipse 中,并使用正斜杠,即
即使您使用的是 Windows。如下所示:/
而不是\
。 ini此外,上述行必须放在之前
-vmargs
。You need to add
javaw.exe
full path with forward slash i.e./
instead\
toeclipse.ini
even you are on Windows. Like below:Also the above lines must be placed before
-vmargs
.添加这个解决了我的问题:
Adding this fixed the issue for me:
将参数大小减少到 -256
请参阅我的 eclipse.ini 文件
Reduce param size upto -256
See my eclipse.ini file
我遇到了以下问题。所以我在 eclipse 安装文件夹中找到了 eclipse.ini 文件。
然后我编辑如下
为 -vm.remove XX 东西添加 java jdk 文件目标并添加 XX:MaxPermSeze=256
i had that following issue. so i did was find that eclipse.ini file in the eclipse installation folder.
then i edited as follows
add java jdk file desitination for -vm.remove XX things and add XX:MaxPermSeze=256
对我来说,它通过更改 Path 环境变量中的 JDK bin 路径来解决。将包含 jre/bin/client/jvm.dll 的 JDK bin 路径放在 JDK home 下。
For me it solved by changing the JDK bin path in the Path environment variable. Put the JDK bin path which has jre/bin/client/jvm.dll under JDK home.
解决问题的步骤:-
从 eclipse 文件夹中打开 eclipse.ini 文件。
它有一些附加配置。找到行 –launcher.XXMaxPermSize。它将是该文件中的最后一行。现在删除/删除默认值 256m 并保存它。
STEPS TO SOLVE THE ISSUE :-
Open the eclipse.ini file from your eclipse folder.
It has some of add on configuration . Find the line –launcher.XXMaxPermSize.It will be the last line in this file. Now remove/delete the the default value 256m and save it.
我面临着同样的问题,我找到了解决方案。 MaxPermSize 的分配存在问题。如果您尝试分配超过计算机可用空间的空间,则会在我的问题中出现此错误。所以尽量减少MaxPermSize。
我想这会帮助你解决你的问题。
I was facing the same problem, and I found the solution. There are issues in allocation of MaxPermSize. If you try to allocate more than your machine's free space then it gives this error in my issue. So try to reduce MaxPermSize.
I think it will help you to sort out your issue.