Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eclipse won't start - no java virtual machine was found

Tags:

java

eclipse

Eclipse was running fine yesterday (and has been since I installed it about a year ago). Now all the sudden I'm getting the following error on startup:

"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 not changed anyhing Eclipse/Java related on my machine but a Windows update was applied to my machine yesterday, so maybe that has something to do with it (but I don't see anything that would affect Java). I've looked at all the other posts about adding something to your PATH or adding the -vm option to the Eclipse ini (couldn't get this to work) or copying the jre folder to eclipse\jre (this worked but doesn't seem like a good long term solution). So I'm really trying to figure out how to get things back to the "default" setup without messing stuff up.

I'm running Windows 7, Eclipse Helios and Java 1.6.0_26.

like image 385
NullReference Avatar asked Sep 14 '12 14:09

NullReference


People also ask

Is Eclipse a Java Virtual Machine?

By default, Eclipse scans your PATH and looks for any JRE if it founds suitable JRE then it runs otherwise it throws "A java Runtime Environment (JRE) or Java Development kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found".


1 Answers

Two ways to work around this .

  • Recommended way : In your eclipse.ini file make sure you are pointing -vm to your jdk installation. More on this here. Make sure to add -vm before the -vmargs section.

  • Pass in the vm flag from command line. http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F#Find_the_JVM

Note : Eclipse DOES NOT consult the JAVA_HOME environment variable.

like image 112
Ajay George Avatar answered Sep 24 '22 01:09

Ajay George