While setting up Eclipse on my development station in order to compare it to NetBeans I encountered the following error:
A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations: c:\Program Files\Eclipse\jre\bin\javaw.exe 'javaw.exe' in your current path
I have Java installed, and it is working properly. It was a big pain to get working properly the first time with NetBeans so I was worried that if I tweaked it to work with Eclipse I may end up with it not working in either. I took a peek into many of the config files for Eclipse and didn’t see an option to set the path for javaw.exe, so I made use of my Google-Fu skills and found the following solution:
- Right Click Eclipse.exe and select Create Shortcut
- Right Click the new shortcut and select Properties
- At the end of the target path, add the parameter -vm and then the path to your javaw.exe
ie: “C:\Program Files\eclipse\eclipse.exe” -vm C:\Java\jdk1.6.0_13\bin
- Hit Ok, then run Eclipse from your new shortcut
Only registered users can comment.
Thanks for the post (dated but still very useful :P)
I will add my 2 cents which may help others looking for a solution to this problem…
For me it only worked if I specified the text as:
“C:\Program Files\eclipse\eclipse.exe” -vm “C:\Java\jdk1.6.0_13\bin”
At first I though it may have been the smart quotes (curly quotes copied from this page) that cam in the way, but even after re-typing them myself it did not work, so I surrounded both paths in double quotes and Eclipse launched just fine 🙂
I hope it helps anyone having the same problem I encountered.
@freakqnc – Thanks for the heads up, my server is Linux based so I’m assuming that’s why the quotes are “curly.” I wouldn’t have noticed that if you didn’t mention it though.
thanx for the post, it helped fixing my problem!
cheers from Venice
Hi, I did the above mentioned -vm “c:\java\jdkx.x.x\bin” step. but after that my eclips run and at once show the following error box, please advise. —————————
JVM terminated. Exit code=-1
-showsplash E:\Eclipse 3.4.2\\plugins\org.eclipse.platform_3.3.101.v200902111700\splash.bmp
-launcher E:\Eclipse 3.4.2\eclipse.exe
–launcher.library E:\Eclipse 3.4.2\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\eclipse_1115.dll
-startup E:\Eclipse 3.4.2\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar
-vm C:\Program Files\Java\jdk1.6.0_18\bin\..\jre\bin\server\jvm.dll
i was struggling with this from a long time. But why this error comes at the first time? Can you please explain?
Thanks! Never thought this would work but it does, after placing the “”-symbols correctly like ‘freakqnc’ explained in his post.
Thanks !!! 🙂
Khurram!!! I’m getting the same error! Did you fix it!?
I tried the root post it prompts another Error stating
Failed to Load JNI Shared Libaray
freakqnc thanks for your 2 cents
Gracias me resulto aplicandondolo con el javaw.exe que se encuenta en el sistem 32.
thanks alot man…
its very useful. i can run eclipse just whit this way…
very helpful…i love this
As alternative to -vm on Windows 7 a junction worked fine for me (easy to switch jre via a script):
c:\eclipse>mklink /J jre c:\glassfish3\jdk7\
Verbindung erstellt fÃ¼r jre c:\glassfish3\jdk7\
If you are using Linux. You should check in “/etc/alternatives” the link “java”, it should be broken.
In this case, you have to type ” sudo ln -s /usr/lib/jvm/$YOUR_JAVA_HOME/bin/java “.
Brienfing, you should find a file with the name “java” in “/usr/lib/jvm/$YOUR_JAVA” and make the link inside of the folder “/etc/alternatives”.
I hope to help linux users.
Thanks this was quite helpful.
Thanks a lot!!!
My Shortcut to eclipse will not open
thanx buddy works fine
Thanks alot.. It is really works..
Didn’t work. This worked for my win7 64 bit:
Manually download java for your operating system:
Change the install folder to the eclipse folder. Done.