Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have a problem with m2eclipse (0.10.0) together with eclipse galileo (Build id: 20090920-1017).

I always get the error message:"Eclipse is running in a JRE, but a JDK is required". I have tried several things, but nothing works. The error message is still there. Here are the things I have tried:

  • In Window>Preferences>Java>Installed JREs I checked JDK1.6.0_20. DOES NOT WORK

  • In Window>Preferences>Java>Installed JREs I removed all JREs. Only the checked JDK1.6.0_20 is still there. DOES NOT WORK

  • In Window>Preferences>Java>Installed JREs>Execution Environments I choosed JavaSE-1.6 and checked JDK1.6.0_20[perfect match]. DOES NOT WORK.

  • In Preferences of the eclipse desktop start icon I added the -vm parameter (C:\Programme\eclipse_galileo\eclipse\eclipse.exe -vm C:\Programme\Java\jdk1.6.0_20\bin). DOES NOT WORK.

  • I added the clean parameter (C:\Programme\eclipse_galileo\eclipse\eclipse.exe -vm C:\Programme\Java\jdk1.6.0_20\bin -clean). DOES NOT WORK.

  • I added the -vm parameter to the eclipse.ini file with a carriage return after -vm and C:/Programme/Java/jdk1.6.0_20/bin/javaw.exe in a new line. DOES NOT WORK.

  • After doing all these things I removed the m2eclipse plugin and installed it once again. DOES NOT WORK.

New ideas I have tried:

  • In Preferences of the eclipse desktop start icon I put the executable at the end (C:\Programme\eclipse_galileo\eclipse\eclipse.exe -vm C:\Programme\Java\jdk1.6.0_20\bin\javaw.exe). DOES NOT WORK.

  • I changed in eclipse.ini the slashes to backslashes. DOES NOT WORK.

Here is my eclipse.ini file:

-startup plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519 -product org.eclipse.epp.package.jee.product --launcher.XXMaxPermSize 256M -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m -vm C:\Programme\Java\jdk1.6.0_20\bin\javaw.exe -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m 

Is anyone out there who have other ideas? Any help is appreciated.

Thank You very much. GernoK

like image 686
GernoK Avatar asked May 27 '10 13:05

GernoK


People also ask

Do we need both JDK and JRE for Eclipse?

Eclipse is a Java-based application and, as such, requires a Java Runtime Environment or Java Development Kit (JRE or JDK) in order to run. Note that on recent versions of Mac, a full JDK needs to be installed, not just a JRE; see instructions below.

Is Eclipse a JDK or JRE?

Eclipse is an IDE that runs on a java VM. It only requires a jre.

Is Jre enough to run Eclipse?

java - A JRE or JDK must be available in order to run Eclipse.


2 Answers

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:

-vm C:\java\jdk\bin\javaw.exe 
like image 184
Jeremy Goodell Avatar answered Sep 24 '22 07:09

Jeremy Goodell


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: -product org.eclipse.epp.package.jee.product -vm C:\java\jdk\bin\javaw.exe save and restart the eclipse. Error will be gone.

like image 42
Ran Azad Avatar answered Sep 21 '22 07:09

Ran Azad