... because from time to time I'm a web developer, too
About me
Projects
Contact
Links

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

December 9, 2009 | java
author: Karol Zielinski | comments: 41 | views: 15274
Tags: , , , , ,

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.

And then…

set your JDK as a 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

open ‘eclipse.ini’ and add there:

-vm
path_to_javaw_on_your_machine

so in my example it will be (jdk1.6.0_17 on Windows):

-vm
C:\Progra~1\Java\jdk1.6.0_17\jre\bin\javaw

Notice 1: Do not use paths with spaces! Replace all dir names with spaces to their shortcuts. For example: ‘Program Files’ is ‘Progra~1′.
Notice 2: ‘-vm’ is in the first line, path is in the second line

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~1\Java\jdk1.6.0_17\jre\bin\javaw
-vmargs
-Xms40m
-Xmx256m

Restart eclipse and everything should be fine.

Really helpful article: old.nabble.com

Bookmark and Share
Post m2eclipse: Eclipse is running in a JRE, but a JDK is required to develway Post m2eclipse: Eclipse is running in a JRE, but a JDK is required to Delicious Post m2eclipse: Eclipse is running in a JRE, but a JDK is required to Digg Post m2eclipse: Eclipse is running in a JRE, but a JDK is required to Facebook Post m2eclipse: Eclipse is running in a JRE, but a JDK is required to Reddit Post m2eclipse: Eclipse is running in a JRE, but a JDK is required to StumbleUpon

Related news and resources

Comments (41)

4Avatars v0.3.1 v0.3.1
m2eclipse: Eclipse is running in a JRE, but a JDK is required
December 9, 2009, 9:05 am

[...] tech.karolzielinski.com Follow us on Twitter 1,510 śledzących RSS Feed 168 czytelników m2eclipse: Eclipse is running in a JRE, but a JDK is required 1 głosuj! Powróciłem ostatnio do jednego ze swoich starych projektów… aplikacji [...]

4Avatars v0.3.1 v0.3.1
macetini
January 26, 2010, 2:18 am

Thanks ;)

4Avatars v0.3.1 v0.3.1
Karol Zielinski
January 26, 2010, 8:51 am

@macetini
your welcome :)

4Avatars v0.3.1 v0.3.1
Dario
February 9, 2010, 11:15 am

Excelent, I’ve found many sites about this issue, this is the only one who helps me with the right step to do.

4Avatars v0.3.1 v0.3.1
cyrus
February 10, 2010, 2:25 am

It worked! I spent a day googleing this issue, and morning this is the first working solution. Many thx!

4Avatars v0.3.1 v0.3.1
mike
February 22, 2010, 4:58 pm

Thanks also, you’re tip about how to shorten ‘Program Files’ dir got me going. Now if you could tell me how to get adb server going I’d bow before you.

4Avatars v0.3.1 v0.3.1
Rolando
March 22, 2010, 8:10 am

Great! For me works fine!

4Avatars v0.3.1 v0.3.1
pidan
March 25, 2010, 7:35 am

Did all this, still getting message =(

4Avatars v0.3.1 v0.3.1
David
March 25, 2010, 2:08 pm

Exactly the solution to my problem after installing m2eclipse.

4Avatars v0.3.1 v0.3.1
Hector
April 8, 2010, 3:18 pm

Hum… it didn’t work for me.

By the way when the jdk path is betwen “” it doesn’t matter if the path has spaces, the same works for any path in cmd instructions.

4Avatars v0.3.1 v0.3.1
Hector
April 8, 2010, 3:35 pm

Ok I found the way…

It seems that sometimes the -vm is the last instruction in the eclipse.ini; however, it has to be moved to before the vmargs.

Then the path has to be as you say, it seems that eclipse.ini does not recognize the quotes

Regards to all, and thanks

4Avatars v0.3.1 v0.3.1
bouali
April 12, 2010, 1:27 pm

thank s a lot

4Avatars v0.3.1 v0.3.1
Kamala
April 14, 2010, 5:47 am

Finally found a page that explains this problem and the solution step by step. Thank you so much.

4Avatars v0.3.1 v0.3.1
sandy
April 14, 2010, 7:10 am

yaah its really works but place -vm before -vmargs thanks a lot

4Avatars v0.3.1 v0.3.1
Niranjan Kumar
April 19, 2010, 12:45 am

It works for me also, Just need to place the -vm on the above specified place. Thanks a lots..:)

4Avatars v0.3.1 v0.3.1
andre
April 22, 2010, 8:13 pm

Thx!!

4Avatars v0.3.1 v0.3.1
hypotechguy
April 26, 2010, 7:58 pm

I found that I also needed to remove the “/javaw” part and just have the path end in “…/bin”. This was with jdk1.6.0_18 on Windows XP SP3. FYI, I am able to run with spaces in the path. Lines 1 and 2 of my eclipse.ini are:

-vm
C:/Program Files/Java/jdk1.6.0_18/bin

4Avatars v0.3.1 v0.3.1
Steve Wall
April 29, 2010, 7:11 am

Thx!

4Avatars v0.3.1 v0.3.1
Bapi
May 6, 2010, 6:05 pm

The Progra~1 may need to be Progra~2 on a Windows 7 install with a 32-bit JDK

4Avatars v0.3.1 v0.3.1
Samuel
May 15, 2010, 3:28 am

I encountered this problem on a linux machine. Please tell me what to do

4Avatars v0.3.1 v0.3.1
big_ben3333
May 15, 2010, 5:19 am

Thank a lot

4Avatars v0.3.1 v0.3.1
Devilock
May 19, 2010, 10:33 am

Thanx a lot!This was really helpful!!!

4Avatars v0.3.1 v0.3.1
Rakesh
June 1, 2010, 2:18 pm

I got the solution of this problem “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” by setting this value in eclipse.ini

-vm
C:\Program files\Java\jdk1.6.0_20\bin

I kept this above ‘-vmargs’ in this file.

4Avatars v0.3.1 v0.3.1
Raunak
June 2, 2010, 10:51 am

Thnx a lot…it helped me…I just added upto /bin part as it was not accepting the file inside the directory.

4Avatars v0.3.1 v0.3.1
Don
June 3, 2010, 2:59 am

Encountered the same problem. This somehow worked not for me on a 64 bit XP. Eclipse, even with the parameters at the correct position, did not started at all. With the (x86) path (the 32 bit jdk) it worked in an instant.

4Avatars v0.3.1 v0.3.1
Draiwn
June 7, 2010, 4:57 am

I lost 3 hours on a 64 bits xp to get it working properly…

Download the 32bits JDK for windows, and add the following lines (according to your configuration) to your eclipse.ini just above ‘-vmargs’ :

-vm
C:/Progra~2/Java/jdk1.6.0_20/bin

4Avatars v0.3.1 v0.3.1
Ballmenace
June 12, 2010, 9:00 am

My solution was to put the javaw.exe path on its own line WITHOUT quotes.
Complete eclipse.ini:

-startup
../../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
–launcher.library
../../Common/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256m
-install
C:/Users/andreas/AppData/Local/Genuitec/Profiles/Eclipse 3.5 Classic
-configuration
configuration
-vm
C:\Program Files (x86)\Java\jdk1.6.0_20\bin\javaw.exe
-vmargs
-Xms40m
-Xmx256m

4Avatars v0.3.1 v0.3.1
Richa
June 14, 2010, 11:38 am

Thanks a loy, it worked for me.

4Avatars v0.3.1 v0.3.1
Hadrian
June 17, 2010, 1:48 am

Thanks heaps for this
x hadrian

4Avatars v0.3.1 v0.3.1
kiran
June 17, 2010, 2:41 pm

thanks for sharing info.
Progra~2 did not work for me for win 7- unable to launch eclipse

changed to Progra~1 and it worked

4Avatars v0.3.1 v0.3.1
Erin
June 22, 2010, 9:37 am

@Samuel, make sure -vm comes before -vmargs.

4Avatars v0.3.1 v0.3.1
Rohit Mittal
June 23, 2010, 10:54 pm

Thanks a lot.
It solved my problem.

4Avatars v0.3.1 v0.3.1
Mimi Prangova
July 9, 2010, 1:39 am

Thanks a lot.
It was very helpful.
In the eclipse.ini file before the -vmargs option I wrote this:
-vm
C:\Program Files (x86)\Java\jdk1.6.0_21\bin

4Avatars v0.3.1 v0.3.1
bikash choudhary
July 11, 2010, 9:44 pm

Thanks its worked for me tooooooooo

4Avatars v0.3.1 v0.3.1
José Reis
July 27, 2010, 4:37 am

Thanks guys! Specially Hector: -vm option really needs to be before -vmargs!!

4Avatars v0.3.1 v0.3.1
Ricardo Vila
July 28, 2010, 3:20 am

I’ve found that on a windows machine the shortcut for eclipse may have the -vm option so it overides the eclipse.ini info. Be careful with this.

4Avatars v0.3.1 v0.3.1
Shantanu
August 17, 2010, 3:19 am

It worked.Thanks to author.
Thanks to google, I’m on the page.

4Avatars v0.3.1 v0.3.1
Ramesh
September 3, 2010, 2:06 pm

Thanks a million. It was very helpful.

4Avatars v0.3.1 v0.3.1
kryptonum
September 6, 2010, 5:56 am

Thank you for the workaround!

4Avatars v0.3.1 v0.3.1
ski
September 7, 2010, 2:02 pm

With your post problem fixed in 15 secs,
thx!

Write a comment

Karol Zielinski :: Just a tech stuff Hello, I'm Karol Zielinski, internet evangelist, an entrepreneur, project manager and a web developer from Gdynia, Poland. I like creative design, good advertisement, social media and all kind of stuff around the web.

Most popular posts

Much more links

Karol Zielinski    |   contact me
Gdynia, Poland
RSS - Just a tech stuff - python, java blog - web development blog Karol Zielinski on twitter Karol Zielinski on LinkedIn Karol Zielinski on facebook Karol Zielinski on delicious Karol Zielinski on digg Karol Zielinski on flickr Karol Zielinski on stumbleupon Karol Zielinski on technorati