"Source folder is not a Java project" error in eclipse

Viewed 106292

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

11 Answers

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

Right click your project > Maven > Update Project

This step will add your project so the issue resolves easily.

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.

open cmd and run the following command in the folder of your project-

mvn eclipse:eclipse

This did the trick for me

If you are having maven project and you are getting this error. You can follow below steps.

  1. Right click on the project and select properties.
  2. Then click on Project Natures
  3. In the dialogue box, click on Add and in the warning click on OK.
  4. Filter java in the popup box and click on OK.
  5. Click on apply and close.

It will add java nature to your maven project and you will not get this error anymore.

Related