Java 安装 Eclipse 时遇到问题:“必须有 jre 或 jdk”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22286097/
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
Trouble installing Eclipse: "A jre or jdk must be available"
提问by user3035566
Whenever I try to run Eclipse, I get the following error dialog:
每当我尝试运行 Eclipse 时,都会收到以下错误对话框:
A jre or jdk must be available in order to run Eclipse. No java virtual machine was found after searching the following locations:
c:\user\ashish\downloads\eclipse\jre\bin\javaw.exe in your current PATH.
必须有 jre 或 jdk 才能运行 Eclipse。搜索以下位置后未找到 java 虚拟机:
c:\user\ashish\downloads\eclipse\jre\bin\javaw.exe 在您当前的 PATH 中。
I've already downloaded Java, the JVM and all. How do I resolve this problem? I'm running 64-bit Windows 7.
我已经下载了 Java、JVM 等等。我该如何解决这个问题?我正在运行 64 位 Windows 7。
回答by Salah
回答by Alex
See the FAQ:
请参阅常见问题解答:
If a JVM is installed in the eclipse/jre directory, Eclipse will use it; otherwise the launcher will consult the eclipse.ini file and the system path variable. Eclipse DOES NOT consult the JAVA_HOME environment variable.
To explicitly specify a JVM of your choice, you can use the -vm command line argument
如果eclipse/jre目录下安装了JVM,Eclipse会使用它;否则启动器将查询 eclipse.ini 文件和系统路径变量。Eclipse 不咨询 JAVA_HOME 环境变量。
要明确指定您选择的 JVM,您可以使用 -vm 命令行参数
回答by Thorbj?rn Ravn Andersen
Unless explicitly told Eclipse just uses the default Java installation on the system, and does not go looking for other Java installations. For Windows it is the one which copies java.exe into the Windows system folder.
除非明确告诉 Eclipse 只使用系统上的默认 Java 安装,并且不会去寻找其他 Java 安装。对于 Windows,它将 java.exe 复制到 Windows 系统文件夹中。
The simplest way to get that is to go to http://java.com/en/download/installed.jspand install what is suggested until the website informs you you have Java.
获得它的最简单方法是访问http://java.com/en/download/installed.jsp并安装建议的内容,直到网站通知您有 Java。
(If Eclipse still does not want to start, be certain that you have the same 32bit/64bit version as was installed above)
(如果 Eclipse 仍然不想启动,请确保您具有与上面安装的相同的 32 位/64 位版本)
回答by kg3
The problems could be 1. JDK for 32 or 64 bit processors - I had a 64 bit processor but my eclipse was looking for 32 bit compatible java 2. I downloaded 32 - bit processor and then updated eclipse.ini file
问题可能是 1. 32 位或 64 位处理器的 JDK - 我有一个 64 位处理器,但我的 eclipse 正在寻找 32 位兼容的 java 2。我下载了 32 位处理器,然后更新了 eclipse.ini 文件
Hence, it worked!!
因此,它奏效了!!
回答by Arun Kumar
Perhaps you might have downloaded the wrong file i.e maybe 32 bit for a 64 bit OS (download 64 bit .exe file), try checking that, saves a lot of time.
也许您可能下载了错误的文件,即对于 64 位操作系统可能是 32 位文件(下载 64 位 .exe 文件),请尝试检查,节省大量时间。