Jonathan Livni
Jonathan Livni

Reputation: 107282

Run Eclipse in JDK?

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:

Upvotes: 3

Views: 1183

Answers (3)

Deepak
Deepak

Reputation: 164

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.

Upvotes: 1

rhinds
rhinds

Reputation: 10043

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.

Upvotes: 7

Tassos Bassoukos
Tassos Bassoukos

Reputation: 16152

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.

Upvotes: 0

Related Questions