3

Is it possible (and how) to run eclipse in JDK and not in a JRE?
When I open eclipse, I keep receiving the following error:

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

(the error is generated by the m2eclipse plug-in)


UPDATE:
Here's some of the relevant configuration I already have:

enter image description here

enter image description here


UPDATE 2
After following rhinds's advice, I split the -vm and path between lines and now I receive the following upon starting eclipse:

enter image description here

My configuration is:

  • win 7 64bit
  • eclipse-SDK-3.6.2-win32
  • jdk-6u25-windows-x64
Jonathan
  • 84,911
  • 94
  • 244
  • 345

3 Answers3

7

Two things you need to check:

Firstly, within Eclipse go to Windows > Preferences > Java > Installed JREs. There should be at least one "JRE" listed and ticked - check if that is pointing to your installed JDK (ignore that it refers to them as installed JREs - you can point this to your JDK) - if its not, then edit the selected JRE and repoint it to you JDK directory

If you are still getting the error, then open up your eclipse.ini file (will be in the root of your eclipse install - open it in a text editor like notepad++ etc) and insert this at the top of the file:

-vm 
C:/Java/jdk1.6/bin/javaw.exe

(obviously pointing to your javaw.exe in your installed JDK directory)

Once your .ini file is updated, restart and you should not get the error anymore.

rhinds
  • 9,501
  • 12
  • 60
  • 107
  • I know it sounds crazy, but you need to have the -vm and the path on seperate lines. Split that and it should be ok.. – rhinds May 30 '11 at 11:09
  • 1
    looks like you are using a 64bit JDK but not JDK - the eclipse version needs to match the JDK, so either point to a 32bit JDK or install the 64bit Eclipse (see similar answer here: http://stackoverflow.com/questions/3781124/eclipse-helios-not-launching/5963823#5963823 ) – rhinds May 30 '11 at 13:00
1

I had the same issue. Firstly do what maven plugin asks you to do as rhinds mentioned. When I did this I still got the error. Later I realized that it was because of the fact that C:\WINDOWS\system32 has java.exe, javaw.exe and javaws.exe. It seems the executable somehow looks at these (probably the PATH), even though the JDK version is explicitly specified in eclipse.ini.

Deepak
  • 164
  • 2
0

Just install the last JDK from Sun^WOracle - Eclipse (and related tools) should pick it up automatically.

Eclipse itself can run with a plain JRE, but maven requires a JDK.

Tassos Bassoukos
  • 15,613
  • 2
  • 31
  • 38