启动eclipse后出现“未找到java虚拟机”错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19278747/
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-12 15:39:56  来源:igfitidea点击:

"no java virtual machine was found" error after starting eclipse

javaeclipsejvmenvironment-variables

提问by Alireza Farahani

When running eclipse, I get this error. "...no java virtual machine was found...". I have searched many threads and post and have set the JAVA_HOME system variable and virtual machine address in eclipse.ini as the posts said but still get that error. I'm really stuck and don't know what to do. please help me

运行 eclipse 时,出现此错误。“……没有找到java虚拟机……”。我搜索了许多线程和帖子,并按照帖子所述在 eclipse.ini 中设置了 JAVA_HOME 系统变量和虚拟机地址,但仍然出现该错误。我真的被困住了,不知道该怎么办。请帮我

Edit:
here is my eclipse.ini file"

编辑:
这是我的 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.v20120522-1813
-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
-vm
C:\Program Files\Java\jdk1.7.0_25\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx768m
-Declipse.buildId=v21.0.0-531062

After changing the position of -vm line to the current position I get this new error:

将 -vm 行的位置更改为当前位置后,我收到此新错误:

 "java was started but returned exit code=13
 -Dosgi.requiredJavaVersion=1.6"

回答by Reimeus

Eclipse does not use the JAVA_HOMEenvironmental variable. Ensure that the -vmflag in eclipse.inipoints to a valid JVM

Eclipse 不使用JAVA_HOME环境变量。确保-vm标志eclipse.ini指向一个有效的JVM

回答by Tim

I ran into something similar with eclipse after installing net beans. None of the fixes that I had found seemed to work. What I ended up having to do is uninstall all versions of Java and then re-installing them. I was running windows 8.

安装 net bean 后,我遇到了与 eclipse 类似的问题。我发现的所有修复程序似乎都不起作用。我最终要做的是卸载所有版本的 Java,然后重新安装它们。我正在运行Windows 8。