Reputation: 24883
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
Upvotes: 4
Views: 28789
Reputation: 1
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
Upvotes: 0
Reputation: 21401
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
Upvotes: 6
Reputation: 28865
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;...
Upvotes: 3
Reputation: 3463
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.
Upvotes: 1
Reputation: 6012
In my case installing the most recent JRE worked well: http://www.oracle.com/technetwork/java/javase/overview/index.html
Upvotes: 1
Reputation: 96
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.
Upvotes: 1
Reputation: 51
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.
Upvotes: 5
Reputation: 17445
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:
Upvotes: 1
Reputation: 22721
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"
Upvotes: 1
Reputation: 23629
Make sure everything is setup correctly under "installed JREs" under the Eclipse preferences.
Upvotes: 0
Reputation: 4260
Check your path variable from Computer's System Properties Environment Variables JAVA_HOME to ocorrect path to your jdk installation
Upvotes: 2