m2eclipse: Eclipse is running in a JRE, but a JDK is required
December 9, 2009 | javaauthor: Karol Zielinski | comments: 41 | views: 15274
Tags: eclipse, java, jdk, jre, m2eclipse, maven
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.
First… install JDK if you don’t have it.
And then…
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’.
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
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.
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 [...]
January 26, 2010, 2:18 am
Thanks
January 26, 2010, 8:51 am
@macetini
your welcome
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.
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!
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.
March 22, 2010, 8:10 am
Great! For me works fine!
March 25, 2010, 7:35 am
Did all this, still getting message =(
March 25, 2010, 2:08 pm
Exactly the solution to my problem after installing m2eclipse.
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.
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
April 12, 2010, 1:27 pm
thank s a lot
April 14, 2010, 5:47 am
Finally found a page that explains this problem and the solution step by step. Thank you so much.
April 14, 2010, 7:10 am
yaah its really works but place -vm before -vmargs thanks a lot
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..:)
April 22, 2010, 8:13 pm
Thx!!
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
April 29, 2010, 7:11 am
Thx!
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
May 13, 2010, 2:49 pm
[...] http://wiki.eclipse.org/Eclipse.ini http://tech.karolzielinski.com/m2eclipse-eclipse-is-running-in-a-jre-but-a-jdk-is-required [...]
May 15, 2010, 3:28 am
I encountered this problem on a linux machine. Please tell me what to do
May 15, 2010, 5:19 am
Thank a lot
May 19, 2010, 10:33 am
Thanx a lot!This was really helpful!!!
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.
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.
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.
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
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
June 14, 2010, 11:38 am
Thanks a loy, it worked for me.
June 17, 2010, 1:48 am
Thanks heaps for this
x hadrian
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
June 22, 2010, 9:37 am
@Samuel, make sure -vm comes before -vmargs.
June 23, 2010, 10:54 pm
Thanks a lot.
It solved my problem.
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
July 11, 2010, 9:44 pm
Thanks its worked for me tooooooooo
July 27, 2010, 4:37 am
Thanks guys! Specially Hector: -vm option really needs to be before -vmargs!!
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.
August 17, 2010, 3:19 am
It worked.Thanks to author.
Thanks to google, I’m on the page.
September 3, 2010, 2:06 pm
Thanks a million. It was very helpful.
September 6, 2010, 5:56 am
Thank you for the workaround!
September 7, 2010, 2:02 pm
With your post problem fixed in 15 secs,
thx!