Eclipse - Importing an existing Maven project gives Unsupported IClasspathEntry kind=4 Error
Solution 1
I finally managed to resolve the reported errors. This is what I followed:
1) My eclipse was 64-bit version, but it was run using a 32-bit JVM. I changed eclipse.ini to use 64-bit JVM.
2) Deleted the project from my workspace.
3) Cleaned eclipse project files using mvn eclipse:clean
. And created the project files again using mvn eclipse:eclipse
4) Imported the project as General > Existing project
in eclipse
5) Built the project
This time, there were no errors reported for Unsupported IClasspathEntry kind=4
. I hope, it helps others facing the same problem. Beware of Eclipse's 32-bit / 64-bit JVM. Prefer to use the same architecture as eclipse - i.e. use 64-bit JVM if your eclipse is 64-bit.
Solution 2
Right-click on your project, select Maven -> Remove Maven Nature. Open you terminal, go to your project folder and do “mvn eclipse:clean” Right click on your Project and select “Configure -> Convert into Maven Project”
Solution 3
For me the best sollution was to clear up the directory from hidden files (I don't know how this structure looks like on Windows OS).
- Remove all hidden files from your project structure
- Be happy
Pat
An OO enthusiast and Java developer, keen on doing the right things the right way.
Updated on June 13, 2022Comments
-
Pat almost 2 years
I have an existing Maven project with correct pom.xml file. I am able to build the project from command line
mvn install
. However, when I import the project as existing Maven Project in eclipse, I getUnsupported IClasspathEntry kind=4
error in eclipse.Further, some of the project's properties are not correctly reflected after the import - E.g. it is a web project, but I do not see
Deployed Resources
under the project structure. I can still see that littleM
on the project icon indicating that it is a maven project.I tried updating the project with
Alt+F5
and refreshed it withF5
as well. Still the same error.I also tried the approach mentioned on this SO post
How to fix error "Updating Maven Project". Unsupported IClasspathEntry kind=4?
- i.e. Disable maven nature, eclipse:clean, re-enable maven nature. Still the same error when I enable maven nature.
Eclipse also shows an error in my pom.xml, but
mvn install
works fine from cmd line.Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:copy-resources (default-cli)
I am not sure if these 2 errors are related or not.
My setup:
- Windows 7 Pro (64 bit)
- JDK 1.6.0_31 (32 bit)
- Eclipse Juno 4.2
- Maven 3.0.5
- m2e 1.4.0