could not find java 2 runtime,Eclipse:找不到Java 2 Runtime Environment

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:

我剛剛安裝了Eclipse 3.5。在我安裝Android插件之前,我需要安裝Java jdk,我做了。重啟后我不能再啟動Eclipse,因為我收到以下錯誤:

Error: could not finde Java 2 Runtime Environment

錯誤:無法找到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?

經歷的是,現在我甚至無法打開我用於PHP編程的其他Eclipse安裝。有什么建議么?

Update:

更新:

This is my eclipse.ini:

這是我的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

11 个解决方案

#1

6

You can explicitely tell your eclipse session which jdk/jre you want it to start with adding the following in your eclipse.ini:

您可以通過在eclipse.ini中添加以下內容來明確地告訴您的eclipse會話,您希望它從哪個jdk / jre開始:

-vm

c:/your/jre/bin/javaw.exe

-vm c:/your/jre/bin/javaw.exe

For more info on how to startup your eclipse refer here

有關如何啟動eclipse的更多信息,請參閱此處

#2

5

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.

我遇到了類似的問題,但Java安裝成功除外。一旦我將c:/ my-path-to-java / jre / bin添加到PATH(系統環境變量),Eclipse就成功啟動了。

#3

3

Change the PATH environment variable from something like

從類似的東西更改PATH環境變量

...;%SystemRoot%\System32;...;C:\Program Files\Java\jdk1.7.0_17\bin;...

to something like

喜歡的東西

...;C:\Program Files\Java\jdk1.7.0_17\bin;...;%SystemRoot%\System32;...

#4

2

Check your path variable from Computer's System Properties Environment Variables JAVA_HOME to ocorrect path to your jdk installation

檢查您的路徑變量從計算機的系統屬性環境變量JAVA_HOME到您的jdk安裝的正確路徑

#5

1

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:

不知道Java安裝是否可能已損壞。您可以在“運行”提示符上運行以下命令並粘貼代碼標記中的內容:

dir /d /s "%JAVA_HOME%" > "%HOMEPATH%\java2.txt" && notepad "%HOMEPATH%\java2.txt"

#6

1

It makes sense that your PHP eclipse won't start either. Eclipse runs on java itself. Probably it cannot find the JRE.

你的PHP eclipse也不會啟動是有意義的。 Eclipse在java本身上運行。可能它找不到JRE。

so I see two possibilities:

所以我看到兩種可能性:

The JRE is corrupt and you should reinstall it

JRE已損壞,您應該重新安裝它

Eclipse is getting confused by the 2 jre (unlikely to me) and you need to point it to the right one (as suggested by Dimistrisli).

Eclipse被2 jre(我不太可能)弄得很困惑,你需要把它指向正確的(正如Dimistrisli建議的那樣)。

#7

1

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)

我遇到過同樣的問題。 Eclipse(3.7)使用JDK 6工作得很好,然后我安裝了JRE 5(請不要問我為什么)

This eclipse wiki page, which seems up to date, states that:

這個日食維基頁面似乎是最新的,它指出:

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

如果在eclipse / jre目錄中安裝了JVM,Eclipse將使用它;否則啟動器將查詢eclipse.ini文件和系統路徑變量。 Eclipse不會參考JAVA_HOME環境變量

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:

事實上,我並沒有改變JAVA_HOME,所以不可能。但是,在同一個wiki頁面的底部,有人添加了:

A comment on the JVM search order (on Windows) - My testing (Windows 7, Eclipse 3.4.1) shows that Eclipse also looks for a JVM in the registry, in my case HKLM\Software\Wow6432Node\JavaSoft\Java Runtime Environment

關於JVM搜索順序的評論(在Windows上) - 我的測試(Windows 7,Eclipse 3.4.1)顯示Eclipse也在注冊表中查找JVM,在我的例子中是HKLM \ Software \ Wow6432Node \ JavaSoft \ Java Runtime Environment

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.

所以我找到了提到的注冊表項,現在它的值為“1.5”,並將其更改為“1.6”,然后重新啟動我的PC(Windows 7),並且瞧 - Eclipse回歸活着。

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.

我同意添加“-vm”可能會解決這個問題,雖然它似乎對我不起作用(也許我沒有將它添加到正確的位置/格式)。但IMO,在我的情況下,注冊表修復是更好的。重新啟動計算機並看到Eclipse恢復正常后,我卸載了JRE 5(通過“添加或刪除程序”)只是為了解決松散的問題。

#8

1

在我的情況下安裝最新的JRE運行良好:http://www.oracle.com/technetwork/java/javase/overview/index.html

#9

1

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.

我最近安裝JDK 7 Update 9時遇到了同樣的問題。我的eclipse沒有打開,當我從CMD運行“java -version”時,它也沒有用。我將PATH變量設置為正確的bin目錄。

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.

無論如何,最終當我將JAVA_HOME設置到新的安裝目錄時,eclipse就開始了。不確定JDK 7 Update 9有什么問題。

#10

0

Make sure everything is setup correctly under "installed JREs" under the Eclipse preferences.

確保在Eclipse首選項下的“已安裝的JRE”下正確設置了所有內容。

#11

0

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

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

此外,通過編輯快捷方式使eclipse快捷方式工作。目標部分中的-Agnd -vm C:\ Java \ jdk1.7.0_72 \ bin \ javaw

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值