Eclipse is running in a JRE, but a JDK is required – Solved Problem Eclipse with JRE and JDK mode. How to resolve common problem with java and eclipse.

Pubblicato da lentux-informatica il

  •  
  •  
  •  
  •  
  •  

After a while I sat to one of my old projects again… web-based JEE system to manage requirements of the projects, with maven as a system to manage this project’s dependencies.

I work on Eclipse , so I wanted to install plugin m2eclipse.

However at the end of the installation, after restart of eclipse, I have an error: “The Maven Integration requires that Eclipse be running in a JDK, because a number of Maven core plugins are using jars from the JDK. (…)”.

How to solve it?

Full error message:




The Maven Integration requires that Eclipse be running in a JDK, because a number of Maven core plugins are using jars from the JDK.

Please make sure the -vm option in eclipse.ini is pointing to a JDK and verify that Installed JRE’s are also using JDK installs.

and the second message:

Eclipse is running in a JRE, but a JDK is required.
Some Maven plugins may not work when importing projects or updating source folders.

 

How to solve it?

  • First… install JDK if you don’t have it.
  • Set your JDK as default Java Environment in Eclipse (default installed JRE).
  • Open eclipse. Click on ‘Window’ -> ‘Preferences’ -> ‘Java’ -> ‘Installed JREs’.
  • If you can’t find any JDK on the list -> click ‘Add’ -> ‘Standard VM’ -> set all paths and click ‘Finish’.
  • After that – check this JDK on the list of installed JREs and click ‘OK’.
  • Add path to your SDK in eclipse.ini.
-vm
C:ProgrammiJavajdk1.6.0_17jrebinjavaw

My full ‘eclipse.ini’ looks like this:

-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
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vm
C:Progra~1Javajdk1.6.0_17jrebinjavaw
-vmargs
-Xms40m
-Xmx256m

Restart eclipse and everything should be fine.


  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •