Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Eclipse in JDK?

Tags:

java

eclipse

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
like image 467
Jonathan Livni Avatar asked Apr 10 '26 12:04

Jonathan Livni


2 Answers

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.

like image 198
rhinds Avatar answered Apr 13 '26 00:04

rhinds


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.

like image 45
Deepak Avatar answered Apr 13 '26 01:04

Deepak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!