55

when i convert to maven project the error is :

> An internal error occurred during: "Updating Maven Project".
> Unsupported IClasspathEntry kind=4

what's the problem?

Matt
  • 14,906
  • 27
  • 99
  • 149
liuzhijun
  • 4,329
  • 3
  • 23
  • 27
  • 5
    possible duplicate of: http://stackoverflow.com/questions/10564684/how-to-fix-error-updating-maven-project-unsupported-iclasspathentry-kind-4 – Mauno Vähä Aug 06 '12 at 16:59
  • 2
    Please take a look at this question : http://stackoverflow.com/questions/10564684/how-to-fix-error-updating-maven-project-unsupported-iclasspathentry-kind-4 – Ashutosh Jindal Aug 06 '12 at 17:06
  • 2
    thanks all,the problems was resolved. the step is :check out the project include 'src' and 'pom.xml' the my eclipse,then convert to maven project. – liuzhijun Aug 08 '12 at 01:41
  • 1
    See this [question](http://stackoverflow.com/questions/10564684/how-to-fix-error-updating-maven-project-unsupported-iclasspathentry-kind-4)... At least it worked for me. – caarlos0 Aug 15 '12 at 19:18

10 Answers10

137

This is all you need:

  1. Right-click on your project, select Maven -> Disable Maven Nature.
  2. Open you terminal, go to your project folder and do “mvn eclipse:clean”
  3. Right click on your Project and select “Configure -> Convert into Maven Project”
RamPrakash
  • 1,687
  • 3
  • 20
  • 25
Alireza Mazloumi
  • 1,752
  • 1
  • 12
  • 11
  • 10
    I followed all these steps, but the problem still remains! – FidEliO Jan 12 '13 at 08:10
  • 3
    In STS 2.9.2 Remove Maven Nature = Disable Maven Nature. – Haim Raman Aug 21 '13 at 14:51
  • fyi - Works on STS 3.6.1 Release / Kepler SR2(4.3.2) – rohtakdev Oct 07 '14 at 08:06
  • Out of all cleaning/reimporting/updating/replacing/editing/closing/opening solutions that I have found on SO, this one worked the most to fix my 5 years old project that contains 300 Java Classes and lots of dependencies. Thank you. – Ali Bassam Oct 27 '14 at 13:55
  • I got myself in this mess and this works nice! I don't what happened... My machine shutdown (overheat) and when I tried to open again to keep working... (nah...) – Fernando Carvalho Aug 06 '16 at 23:20
15

Here is what worked for me: After the steps posted in Answer 21 above (the last being Convert to Maven Project), I did:

  1. mvn eclipse:eclipse - this regenerates your .project and .classpath files (both of which were blown away by mvn eclipse:clean in step (2) above)

  2. In Eclipse, I right-clicked my project(s) and then Maven > Update Project

I did not see the Unsupported IClasspathEntry kind=4 message anymore :)

Chintan Rathod
  • 25,864
  • 13
  • 83
  • 93
George
  • 151
  • 1
  • 2
  • You might want to check this one as weLL: http://stackoverflow.com/questions/10564684/how-to-fix-error-updating-maven-project-unsupported-iclasspathentry-kind-4 – George Feb 05 '13 at 20:28
  • 1
    This worked for me, but the answer provided by @AlirezaMazloumi did not. –  Apr 08 '13 at 00:14
15

As posted here, the problem is the command line eclipse project generation. So, do not use mvn eclipse:eclipse instead do:

  1. delete your project from eclipse (without deleting it from your file system)
  2. do mvn eclipse:clean in your command line inside your project folder
  3. delete .classpath .project .settings in your project folder (if they still exist after doing 2.)
  4. in eclipse import your project as an "Existing Maven Projects" and it should work flawlessly
pabloi
  • 547
  • 6
  • 9
  • finally this one worked for me. phew :) Note - I tried each and every other solution around this problem but nothing worked. I am using Kepler with latest m2e plugin i.e. 1.4.1 and must say this bug is a real pain. – Gautam Apr 17 '14 at 18:45
  • Yes!!! Thank you!!! This is the absolutely correct answer! None of the others worked for me, but this one did. Beautifully! – markvgti Jul 07 '14 at 11:57
  • Many Thank's, you had save me – zedtimi Feb 18 '16 at 10:10
0

Revert back to an earlier commit/change fixes the problem.... so it could be some corrupted project/mvn file issue, somehow. So, I followed the steps to clean up and then import the project.It worked after a couple attempts.

Joey Tang
  • 1
  • 1
0

An internal error occurred during: "Importing Maven projects". Unsupported IClasspathEntry kind=4

  1. Right-click on your project, select Maven -> Remove Maven Nature. 2.Open you terminal, go to your project folder and do “mvn eclipse:clean” 3.Right click on your Project and select “Configure -> Convert into Maven Project”

also delete project from eclipse. and run: mvn eclipse:clean then import project again.

Ahmed
  • 291
  • 3
  • 3
0

In my case the problem was a .settings-folder commited to svn. it contained the wrong settings (in my case the jdk was set to wrong location). So deleting .settings on svn and doing a clean checkout did it.

dermoritz
  • 12,519
  • 25
  • 97
  • 185
0

Following worked for me: Right-click project, select Maven -> Remove Maven Nature. Close Eclipse go to project folder on command prompt and do “mvn eclipse:clean” Start Eclipse Right click on Project and select “Configure -> Convert into Maven Project”

Amit S
  • 151
  • 9
0

I meet the same problem before when I import a project as a maven project. what I did is like is right click project and choose Maven -> Update Project... (Alt-F5) on the context menu. In the Update Maven Project dialog, ensure that "Update project configuration from pom.xml" is checked. Then press OK.

The issue should be resolved.

Another way is, you go to Problem tab, and find the Error, there is a hint saying that right click it and use Quick fix to resolve the problem.

Richard
  • 2,080
  • 18
  • 17
0

This issue has been fixed in m2e 1.5.0 which is available for Eclipse Kepler (4.3) and Luna (4.4)

Please see https://bugs.eclipse.org/bugs/show_bug.cgi?id=374332#c14

The problem is caused by the fact that STS (the Spring IDE/Eclipse), as well Eclipse and other Eclipse based IDE's, use the m2e(clipse) plugin but that eclipse:eclipse has been probably been run on the project. When m2e encounters a "var" .classpath entry, it throws this error.

The update sites are specified at the following url: http://download.eclipse.org/technology/m2e/milestones/1.6/

Pushkar
  • 727
  • 1
  • 7
  • 21
-1
  1. Switch to terminal and type command mvn eclipse:clean
  2. Right-click on you project, select Maven -> Update Project

Okay, everything is settled

xavierzhao
  • 780
  • 9
  • 18