Eclipse can’t find the Java Virtual Machine

eclipsejavatroubleshooting

I'm having problems getting Eclipse to start… It can't find the Java virtual machine. Based on suggestions online, I've tried adding…

; "C:\Program Files (x86)\Java\jre6\bin"

to my Path variable, and also I've tried adding the following two lines…

-vm
C:/Program Files (x86)/Java/jre6/bin/client/jvm.dll

to my eclipse.ini file. Neither seems to work yet.

The exact error message when I try and open eclipse is…

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\eclipse\jre\bin\javaw.exe javaw.exe in your current PATH

I've verified that Java works, and that it's at the location I was expecting… Still no go.

Best Answer

The -vm argument should be your path to java.exe, or actually javaw.exe (javaw.exe doesn't have a DOS prompt hanging around).

-vm  "C:\Program Files (x86)\Java\jre6\bin\javaw.exe"

Make sure the bitsize matches - you need to match the bitsize of your java (32 bit in your example) and Eclipse (needs to be 32 bit, but 64 bit is available).

Related Question