m2eclipse: Eclipse is running in a JRE, but a JDK is required m2eclipse: Eclipse is running in a JRE, but a JDK is required java java

m2eclipse: Eclipse is running in a JRE, but a JDK is required


Unbelievable, the solution to this problem has nothing to do with slashes, backslashes, quotes, spaces, jre, jdk, jvm, javaw, ....

The answer is that you have to have a line break between

-vm

and the path.

So in the eclipse.ini file:

THIS WILL NOT WORK:

-vm C:\java\jdk\bin\javaw.exe

BUT THIS WILL:

-vmC:\java\jdk\bin\javaw.exe


MARIO-ORTEGON answered is the right answer to this problem. The only thing you need to do is to move this line "-vm C:\java\jdk\bin\javaw.exe" under the section -product org.eclipse.epp.package.jee.product in eclipse.ini. like this: -productorg.eclipse.epp.package.jee.product-vmC:\java\jdk\bin\javaw.exesave and restart the eclipse. Error will be gone.


I think these are answers needed when editing the eclipse.ini or STS.ini files:

A lot of people make these mistakes because they make certain assumptions (which is not correct):

  1. Mistake #1: Writing the parameters in the same line. Unlike JVM command line, Eclipse expects every parameters to be placed in different line in its eclipse.ini file.One of the most common mistake is (which should be written in 2 separated lines):

    -vm c:/Java/jdk1.6.0_31/bin/javaw.exe

  2. Mistake #2: Writing the -vm and -vmargs in the wrong order. Sequence does matter. The -vmargs has to be put before the -vm. Why? Because once the -vm has been specified, the VM will be fully specified and the rest of the -vmargs will be ignored.

  3. Mistake #3: Assuming the eclipse.ini will stay the same if you don't change it. Some plugins installation may have auto configuration (which after restarting automagically change the eclipse.ini file, or other .ini config file, e.g. STS.ini if you are using SpringSource Tool Suite for example), they will append indiscriminately the -vm before the -vmargs. Check for double occurrence of -vm or -vmargs.

  4. Mistake #4: Pointing to the path of JVM, instead of the binary when specifying -vm. Eclipse expects the Java JVM binary, not just the JAVA_HOME path e.g. -vm c:/Java/jdk1.6.0_31/bin/javaw.exe not just -vm c:/Java/jdk1.6.0_31

For the original question, it seems the Mistake #2 is the cause. Instead of the one, you should move the -vm to the end, after -vmargs:

-startupplugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar--launcher.libraryplugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519-productorg.eclipse.epp.package.jee.product--launcher.XXMaxPermSize256M-showsplashorg.eclipse.platform--launcher.XXMaxPermSize256m-vmargs-Dosgi.requiredJavaVersion=1.5-Xms40m-Xmx512m-vmC:\Programme\Java\jdk1.6.0_20\bin\javaw.exe