I am trying to import maven project into eclipse 4.2 version.Its not importing the project properly. Its giving me error "Source folder is not a Java project" while I am trying to create a new call in it. Even ctrl+mouse click is also not working. I don't understand the problem. Even when I right click on project and select build path it shows me no action available. Anyone face the same issue
12 Answers
In the maven project directory try
mvn eclipse:eclipse
that may do the trick.

- 3,458
- 4
- 27
- 46
-
12It 2015 now and Eclipse still doesn't do that when creating a new Maven project from within Eclipse? Just poor. – Thomas Weller Sep 28 '15 at 07:55
-
7It's 2017 and Eclipse doesn't give a damn to this bug. – Rahul Jain Sep 27 '17 at 07:34
-
I just ran into this myself after importing a maven project. I also had to do a mvn clean – jroot Jun 07 '18 at 16:57
-
10It's 2019 and Eclipse doesn't give a damn to this bug. – devcodes Mar 08 '19 at 10:02
-
I restarted STS (Based on eclipse) and then it picked up that it is a java project. – Christopher Barrett Apr 12 '19 at 13:22
-
Alternative to this solution is Right click your project > Maven > Update Project – Pujan Shah Mar 03 '20 at 06:58
-
5We are in 2020 and Eclipse doesn't even care. – WowBow Mar 03 '20 at 12:46
-
2It's 2021, this is so old school – Jimit Patel Feb 15 '21 at 09:26
-
It's 2022, this is so old school – Ryan Fu Mar 11 '22 at 04:46
-
1It's 2023 and the issue still exists. – Lungelo Mar 08 '23 at 09:30
I ran into the same issue and fixed it by converting my project to faceted form.
Right click your project > Properties > Project Facets > Convert to Faceted Form, and select Java.

- 2,007
- 1
- 26
- 31
I had the same problem... But you just need to update "source Folder" to correct source "src/main/java" from whatever mentioned in the pop up:
[]

- 1,978
- 1
- 19
- 38

- 174
- 1
- 5
I got the same error in a slightly different context (Indigo with m2eclipse):
I imported a multi-module (1 jar module and 1 war module) maven project into Eclipse. Everything worked fine (clean, install OK) until I tried to add a new class to one of the modules and got the "Source Folder is not a Java project" error.
I solved this by opening the properties on the parent project and selecting the following Project Facets:
Java
Dynamic Web Module
This solved the problem. My guess is that, because the parent project for a multi-module project has pom packaging (<packaging>pom</packaging>
), Eclipse doesn't know what kind of projects the parent project encloses (i.e. if the packaging were jar, it would know that it's a java project; if the packaging were war, it would know that it's a static or dynamic web module, etc.)
This is just my guess, but the fix worked for me, and it makes sense.

- 535
- 1
- 5
- 12
-
I had the same issue with maven multi module projects and this pretty much solved it. Thanks :) – malintha Jun 27 '14 at 06:26
-
A similar thing just happened to me. I had accidentally left a `
pom ` designation on the child POMs in a multi-module product. I didn't need to change any facets—I merely removed the project from Eclipse, corrected the POMs, and re-imported the project into Eclipse. – Garret Wilson May 23 '23 at 17:17
for those who already see java selected, uncheck and check it again. select apply to override the existing setttings. finally it works !
Right click your project > Properties > Project Facets > Convert to Faceted Form, and select Java

- 189
- 3
- 7
Right click your project > Maven > Update Project
This step will add your project so the issue resolves easily.

- 775
- 10
- 15
open cmd and run the following command in the folder of your project-
mvn eclipse:eclipse
This did the trick for me

- 4,081
- 10
- 26
- 36

- 21
- 2
I had this error because I tried to create a new Project by doing "Ctrl+N", typing "Project" on the Wizard's input label and then just pushing "Enter" until it was created. I solved this by typing "Java Project" instead of just "Project". You can also create a JAVA PROJECT by going to File > New > Java Project.

- 11
- 1
If you are having maven project and you are getting this error. You can follow below steps.
- Right click on the project and select properties.
- Then click on Project Natures
- In the dialogue box, click on Add and in the warning click on OK.
- Filter java in the popup box and click on OK.
- Click on apply and close.
It will add java nature to your maven project and you will not get this error anymore.

- 2,886
- 4
- 24
- 42
Right click your project > Properties > Project Facets > Convert to Faceted Form, select Java, and apply&close

- 1