eclipse 无法在eclipse中创建java虚拟机弹出消息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10105743/
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
Can not create java virtual machine popup message in eclipse
提问by user1325695
I want to log the GC details and added following VM argument in eclipse:
我想记录 GC 详细信息并在 Eclipse 中添加以下 VM 参数:
-verbose:gc
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-Xmx768M
Now when I launch the application I get an error dialog that states "can not create java virtual machine".
现在,当我启动应用程序时,我收到一个错误对话框,指出“无法创建 Java 虚拟机”。
What is the problem?
问题是什么?
回答by Chander Shivdasani
The following linkexplains how to supply VM arguments in eclipse.
以下链接解释了如何在 eclipse 中提供 VM 参数。
Now when I launch the application I get an error dialog that states "can not create java virtual machine".
现在,当我启动应用程序时,我收到一个错误对话框,指出“无法创建 Java 虚拟机”。
There could be quite a few reasons for this. One common one is that eclipse cant find the java executable. You can open the eclipse.ini file and add:
这可能有很多原因。一种常见的情况是 eclipse 找不到 java 可执行文件。您可以打开 eclipse.ini 文件并添加:
-vm
/opt/jdk/bin/javaw.exe
You should replace the above path with the path of your executable.
您应该将上述路径替换为可执行文件的路径。
回答by dev-vb
We were facing a similar problem. We uninstalled java 7 and replaced it with java 6 (http://www.java.com/en/download/manual_v6.jsp) and this worked for us. (above suggested changes - editing .ini file with vm, etc. - didn't work for us! it just brought up a different error message).
我们面临着类似的问题。我们卸载了 java 7 并将其替换为 java 6 ( http://www.java.com/en/download/manual_v6.jsp),这对我们有用。(以上建议的更改 - 使用 vm 编辑 .ini 文件等 - 对我们不起作用!它只是带来了不同的错误消息)。
One issue we did face is in getting 'java -version' in command prompt to work. We were seeing the following error: "java error in opening registry key". The selected answer (removing java.exe, etc. files from windows/system32 folder) at the following link worked and we were good to go.
我们确实面临的一个问题是让“java -version”在命令提示符下工作。我们看到以下错误:“打开注册表项时出现 java 错误”。以下链接中的选定答案(从 windows/system32 文件夹中删除 java.exe 等文件)有效,我们很高兴。
回答by Shanker Kaura
Check to see if you have multiple entries for "-vm" in your eclipse.ini file. Multiple entries will cause this error to appear.
检查您的 eclipse.ini 文件中是否有多个“-vm”条目。多个条目将导致出现此错误。
回答by Emran Hamza
I have found very easy solution for this just delete eclipse.ini file but backup first.
我找到了非常简单的解决方案,只需删除 eclipse.ini 文件但先备份。
i had this same problem many times and finally i deleted this and i have no more problem.
我多次遇到同样的问题,最后我删除了它,我再也没有问题了。
it also increased loading time. now my eclipse starts faster then earlier.
它还增加了加载时间。现在我的日食开始得更快了。