Could not create the Java virtual machine

Can anyone help me solve this mind numbing problem. I got the latest version of Java SE 1.6.0_13 JDK and I also have the standalone JRE. I’ve download eclipse and I would have assumed eclipse would be using the JDK.

But when I boot up eclipse, I get this message:

4/30/09 2:23:00 PM PDT: Eclipse is running in a JRE, but a JDK is required
Some Maven plugins may not work when importing projects or updating source folders.

I did some googling and people say adding this to the eclipse.ini file solves the problem:

-vm “C:\Java\jdk1.6.0_13\bin\javaw.exe”

Note: That is where both my JDK and JRE is installed.

But to no avail I still get the message. And then I try to start eclipse.exe and manually add the -vm parameter like this:

eclipse.exe -vm “C:\Java\jdk1.6.0_13\bin\javaw.exe”

And I get this error: Could not create the Java virtual machine

I did some googling, but no one has been able to help. Does anyone know what is going on? I just want eclipse to use the jdk.

I imagine there may be some differences between NetBeans and Eclipse, but I had to both SET PATH and SET CLASSPATH in my autoexec.bat file. eg.

PATH=C:\\WINDOWS;C:\\WINDOWS\\COMMAND;C:\\J2SDK1~1.2_1\\JRE;C:\\J2SDK1~1.2_1\\BIN;
SET JAVA_HOME=C:\\J2SDK1~1.2_1
SET CATALINA_HOME=C:\\PROGRA~1\\NETBEA~1.0\\NB4.0\\JAKART~1.28
SET CLASSPATH=%CLASSPATH%;.;C:\\J2SDK_~1\\JDK14~1.0\\LIB\	ools.jar
 

a bit of a mess, but it might give you an idea what you might need to do.

Thanks for the advice. But I tried to set the PATH, JAVA_HOME, CLASS_PATH in the environment variables for my windows and no avail. Same problem.

Any other ideas?

Uninstall your Java installs (all of them) and Eclipse then install the latest JDK (only, the JDK includes the JRE, you don’t need two) and reinstall Eclipse.

It sounds like Windows is using the JRE java.exe to launch Eclipse. Yes, you could probably figure out where the problem is and fix it, eventually, but uninstalling and reinstalling will have you up and running within 10 minutes or so.

Probably a typo, but it’s CLASSPATH not CLASS_PATH