4

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
Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
Pascal Klein
  • 23,665
  • 24
  • 82
  • 119

11 Answers11

6

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

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

For more info on how to startup your eclipse refer here

Cephalopod
  • 14,632
  • 7
  • 51
  • 70
dimitrisli
  • 20,895
  • 12
  • 59
  • 63
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.

Bo Persson
  • 90,663
  • 31
  • 146
  • 203
makbeta
  • 51
  • 1
  • 2
3

Change the PATH environment variable from something like

...;%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;...
palacsint
  • 28,416
  • 10
  • 82
  • 109
2

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

Yusuf K.
  • 4,195
  • 1
  • 33
  • 69
  • I created the variable JAVA_HOME with the value "C:\Programme\java\jdk1.6.0_23" but it didnt work. Do I have to reference a specific file within that folder? – Pascal Klein Dec 08 '10 at 14:33
  • @paskster Maybe adding JAVA_HOME wants to restarting computer. Otherwise I think installing JDK again will solve your problem. – Yusuf K. Dec 08 '10 at 14:37
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.

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.

endless
  • 3,316
  • 4
  • 26
  • 33
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:

dir /d /s "%JAVA_HOME%" > "%HOMEPATH%\java2.txt" && notepad "%HOMEPATH%\java2.txt"
Chris Dennett
  • 22,412
  • 8
  • 58
  • 84
1

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:

  • The JRE is corrupt and you should reinstall it
  • 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).
Joeri Hendrickx
  • 16,947
  • 4
  • 41
  • 53
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)

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

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:

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

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.

Ophir
  • 96
  • 2
1

In my case installing the most recent JRE worked well: http://www.oracle.com/technetwork/java/javase/overview/index.html

Moss
  • 6,002
  • 1
  • 35
  • 40
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

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

0

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

jzd
  • 23,473
  • 9
  • 54
  • 76