未找到 Java 虚拟机 (Eclipse)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21691997/
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
No Java virtual machine was found (Eclipse)
提问by Insederec
When trying to run Eclipse Kepler (for the first time), I get the following error:
尝试运行 Eclipse Kepler(第一次)时,出现以下错误:
I am aware that this issue has been solved many times before. However, I have changed eclipse.ini to say -vm C:\Program Files (x86)\Java\jdk1.6.0_21\bin\javaw.exe
but to no avail. The same error always comes up.
我知道这个问题以前已经解决过很多次了。但是,我已经更改了 eclipse.ini 说-vm C:\Program Files (x86)\Java\jdk1.6.0_21\bin\javaw.exe
但无济于事。总是出现同样的错误。
===UPDATE===
I added a line break after -vm
and now I get this dialog box:
===更新=== 我在之后添加了一个换行符-vm
,现在我得到了这个对话框:
and the eclipse.ini file:
和 eclipse.ini 文件:
-vm
C:\Program Files (x86)\Java\jdk1.7.0_51\jre\bin\javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130807-1835
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m
回答by cmd
The problem is that you are trying to start a 64 bit version of Eclipse with a 32 bit version of Java. The bitness should match. You can download 64 bit Java here
问题是您正在尝试使用 32 位版本的 Java 启动 64 位版本的 Eclipse。位数应该匹配。你可以在这里下载 64 位 Java
Start Eclipse with a 64 bit JVM and the problem will go away.
使用 64 位 JVM 启动 Eclipse,问题就会消失。
To do so:
这样做:
eclipse.exe -vm c:\path\to\bit\bin\javaw.exe
You can also update the the first two lines in your eclipse.ini
file to use the 64 bit java by default by doing the following:
您还可以eclipse.ini
通过执行以下操作更新文件中的前两行以默认使用 64 位 java:
-vm
c:\path\to\bit\bin\javaw.exe
(NOTE: be sure the argument and value each exist on a separate line)
(注意:确保参数和值分别存在于单独的行中)
Also, you can also download a 32 bit version of Eclipse for use with 32 bit Java. The key is that the bitness is the same.
此外,您还可以下载 32 位版本的 Eclipse 以与 32 位 Java 一起使用。关键是位数是一样的。
回答by nitind
You are pointing your 64-bit Eclipse at a 32-bit Java installation. They need to match. You can either get and use the equivalent 32-bit Eclipse download or make sure you install a 64-bit Java.
您将 64 位 Eclipse 指向 32 位 Java 安装。他们需要匹配。您可以获取并使用等效的 32 位 Eclipse 下载,或者确保您安装了 64 位 Java。
回答by E-Riz
You were correct to place -vm
and the path on separate lines in eclipse.ini
. The error shown in your updated screen shot indicates that you're running 64-bit Eclipse on a 32-bit JDK, which doesn't work. The bit-ness of them have to match.
您-vm
在eclipse.ini
. 更新后的屏幕截图中显示的错误表明您在 32 位 JDK 上运行 64 位 Eclipse,这不起作用。它们的位数必须匹配。
回答by Col.
No need to open eclipse.ini, just follow the path its requesting to launch it ie....most jre folders have an added extension to the name eg. jre1.8.0_45, just cut that folder from java folder and paste in eclipse folder and delete the extension. It becomes just jrenow launch eclipse it should work.
无需打开 eclipse.ini,只需按照其请求启动它的路径即可,即....大多数 jre 文件夹都添加了名称的扩展名,例如。jre1.8.0_45,只需从java文件夹中剪切该文件夹并粘贴到eclipse文件夹中并删除扩展名。它变成了jre现在启动 eclipse 它应该可以工作。
回答by user5372490
Run java.exe from C:Prgram Files...\bin. A cmd promt will be running. Just minimize it and then try running eclipse.exe. Worked for me
从 C:Prgram Files...\bin 运行 java.exe。将运行 cmd 提示符。只需将其最小化,然后尝试运行 eclipse.exe。对我来说有效
回答by Ghalib
I am facing the same problem. I found that due to installation of JDK, I removed the path "C:\ProgramData\Oracle\Java\javapath" in the PATH environment variable that caused the problem. SO I added this path again and it works fine.
我面临同样的问题。发现是因为安装了JDK,把导致问题的PATH环境变量中的路径“C:\ProgramData\Oracle\Java\javapath”去掉了。所以我再次添加了这条路径,它工作正常。
回答by shaoyl85
Can you try one of these?
您可以尝试其中之一吗?
(1) just copy the jre to the directory it asked.
(1) 只需将 jre 复制到它要求的目录中即可。
(2) add the jvm path to system path, which is located under control panel -> system -> advanced -> environment variables.
(2) 将jvm路径添加到系统路径中,该路径位于控制面板->系统->高级->环境变量下。
回答by Jason
Forgot this is Windows... quotes. I think you need to put it in quotes because there are spaces in the string. -vm "C:\Program Files (x86)\Java\jdk1.6.0_21\bin\javaw.exe"
忘了这是 Windows... 报价。我认为您需要将其放在引号中,因为字符串中有空格。-vm "C:\Program Files (x86)\Java\jdk1.6.0_21\bin\javaw.exe"
回答by Vivek
instead of using "Program Files(x86)" in the path try using something like C:\Progra~2\Java\jre7\bin\javaw.exe - for 32 Bit C:\Progra~1\Java\jre7\bin\javaw.exe - for 64 bit
而不是在路径中使用“程序文件(x86)”尝试使用类似 C:\Progra~2\Java\jre7\bin\javaw.exe - 对于 32 位 C:\Progra~1\Java\jre7\bin\ javaw.exe - 64 位
It worked for me
它对我有用
回答by Dois
For people who have tried the above solutions, as I have, and despite ensuring the same bitness and giving the direct path etc. still failing to get it to work - here's what did it for me.
对于像我一样尝试过上述解决方案的人,尽管确保了相同的位数并提供了直接路径等,但仍然无法使其正常工作 - 这就是为我所做的。
-vm java\bin
-vm java\bin
I pointed to the bin folder and Eclipse found the file it wanted (whatever it was) automatically, so try that out.
我指向 bin 文件夹,Eclipse 自动找到了它想要的文件(无论它是什么),所以试试看。
Note: I put my jre in my Eclipse folder so the path is that short for me... basically, just try pointing to the bin folder instead of a specific file.
注意:我把我的 jre 放在我的 Eclipse 文件夹中,所以路径对我来说很短......基本上,只需尝试指向 bin 文件夹而不是特定文件。