Eclipse:找不到 Java 2 运行时环境
我刚刚安装了 Eclipse 3.5。在安装 Android 插件之前,我需要安装 Java jdk,我也这样做了。重新启动后,我无法再启动 Eclipse,因为我收到以下错误:
错误:找不到 Java 2 运行时 环境
奇怪的是,现在我什至无法打开我用于 PHP 编程的其他 Eclipse 安装。有什么建议吗?
更新:
这是我的 eclipse.ini:
<前><代码>-启动 插件/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar --launcher.library 插件/org.eclipse.equinox.launcher.win32.win32.x86_64_1.0.200.v20090519 -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256米 -vmargs -Xms40米 -Xmx256米
I just installed Eclipse 3.5. Before I could install the Android Plugin I needed to install a Java jdk, which I did. After restart Im not able to start Eclipse anymore, because I receive the following error:
Error: could not finde Java 2 Runtime
Environment
The weired thing is, that now I cant even open my other Eclipse Installations, that I use for PHP Programming. Any suggestions?
Update:
This is my eclipse.ini:
-startup plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.0.200.v20090519 -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m -vmargs -Xms40m -Xmx256m
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
您可以通过在 eclipse.ini 中添加以下内容来明确告诉 Eclipse 会话您希望它启动哪个 jdk/jre:
有关如何启动 Eclipse 的更多信息,请参阅此处
You can explicitely tell your eclipse session which jdk/jre you want it to start with adding the following in your eclipse.ini:
For more info on how to startup your eclipse refer here
我也遇到了类似的问题,只是Java安装成功了。
将 c:/my-path-to-java/jre/bin 添加到 PATH(系统环境变量)后,Eclipse 成功启动。
I had a similar problem, with exception that Java was installed successfully.
Once I added c:/my-path-to-java/jre/bin to PATH (system environment variable), Eclipse started successfully.
将
PATH
环境变量从类似更改为类似
Change the
PATH
environment variable from something liketo something like
从计算机的系统属性环境变量 JAVA_HOME 检查路径变量以获取 jdk 安装的正确路径
Check your path variable from Computer's System Properties Environment Variables JAVA_HOME to ocorrect path to your jdk installation
想知道 Java 安装是否可能已损坏。您可以在“运行”提示符下运行以下命令并将您获得的内容粘贴到代码标签中吗:
Wonder if the Java install might be corrupt. Can you run the following on the Run prompt and paste what you get in code tags:
您的 PHP eclipse 也不会启动,这是有道理的。 Eclipse 本身在 java 上运行。可能是找不到 JRE。
所以我看到两种可能性:
It makes sense that your PHP eclipse won't start either. Eclipse runs on java itself. Probably it cannot find the JRE.
so I see two possibilities:
我有同样的问题。 Eclipse (3.7) 在 JDK 6 上工作了一段时间,然后我安装了 JRE 5(请不要问我为什么)
这个 Eclipse wiki 页面,似乎是最新的,指出:
事实上,我没有更改 JAVA_HOME 所以不可能是这样。
然而,在同一维基页面的底部,有人添加了:
所以我找到了提到的注册表项,它现在的值为“1.5”并将其更改为“1.6”,然后重新启动我的电脑(Windows 7),瞧 - Eclipse 又恢复正常了。
我同意添加“-vm”可能会解决这个问题,尽管它似乎对我不起作用(也许我没有将其添加到正确的位置/格式)。但在我看来,注册表修复对我来说是更好的修复。重新启动计算机并看到 Eclipse 恢复正常后,我卸载了 JRE 5(通过“添加或删除程序”)只是为了解决未解决的问题。
I had the same issue. Eclipse (3.7) worked just fine for a while with JDK 6, and then I installed JRE 5 (please don't ask me why)
This eclipse wiki page, which seems up to date, states that:
And indeed, I did not change JAVA_HOME so that couldn't be it.
However, at the bottom of the same wiki page, someone added:
So I found the mentioned registry entry, which now had the value of "1.5" and changed it to "1.6", then restarted my PC (windows 7), and voila - Eclipse went back alive.
I agree that adding "-vm" might fix this, although it didn't seem to work for me (maybe I didn't add it in the right place/format). But IMO, the registry fix was the better one in my case. After restarting my computer and seeing Eclipse was back to normal, I uninstalled JRE 5 (through "Add or remove programs") just to tie up loose ends.
就我而言,安装最新的 JRE 效果很好: http://www.oracle.com/javase/overview/index.html oracle.com/technetwork/java/javase/overview/index.html
In my case installing the most recent JRE worked well: http://www.oracle.com/technetwork/java/javase/overview/index.html
当我最近安装 JDK 7 Update 9 时,我遇到了同样的问题。我的 eclipse 没有打开,当我从 CMD 运行“java -version”时,它也不起作用。
我将 PATH 变量设置为正确的 bin 目录。
无论如何,最终当我将 JAVA_HOME 设置为新的安装目录时,eclipse 启动正常。不确定 JDK 7 Update 9 有什么问题。
I had the same problem when I recently installed JDK 7 Update 9. My eclipse did not open and when I run "java -version" from CMD, it did not work either.
I had PATH variable set to the correct bin directory.
Anyways, eventually when I set JAVA_HOME to the new installation directory, eclipse started fine. Not sure what is the problem with JDK 7 Update 9.
确保 Eclipse 首选项下“已安装的 JRE”下的所有设置均正确。
Make sure everything is setup correctly under "installed JREs" under the Eclipse preferences.
对我有用的简单解决方案,因为其他分辨率需要管理员权限,因此从命令提示符
eclipse -vm C:\Java\jdk1.7.0_72\bin\javaw
执行以下命令另外,要通过编辑快捷方式使 eclipse 快捷方式工作.在目标部分追加 -vm C:\Java\jdk1.7.0_72\bin\javaw
The simple solution that worked for me, since other resolution required admin privilege is executing the below command from command prompt
eclipse -vm C:\Java\jdk1.7.0_72\bin\javaw
Also, to make the eclipse shortcut work by editing the shortcut.Append -vm C:\Java\jdk1.7.0_72\bin\javaw in the target section