13

In STS 4, my Java 10 Spring Boot 2.1 project warns me:

Unknown referenced nature: org.springframework.ide.eclipse.core.springnature

How can I fix this?

Jan Nielsen
  • 8,956
  • 12
  • 56
  • 105

4 Answers4

10

Open the .project file in your source folder and comment/delete this line:

<nature>org.springframework.ide.eclipse.core.springnature</nature>
ibercode
  • 933
  • 2
  • 13
  • 24
  • This should be marked as the correct answer. It is cleaner, faster and easier to implement than what is marked as the correct answer. – Joseph Waweru Jul 08 '20 at 05:44
7

This is a left-over from a prior STS brought-in by the .project file due to a known issue.

To fix this, delete the project from your workspace(s) in STS, and remove the project meta-data from the file system:

  rm .project
  rm .classpath
  rm .factorypath
  rm -rf .settings

When you re-import the project, STS 4 will build proper project meta-data.

Jan Nielsen
  • 8,956
  • 12
  • 56
  • 105
  • In case this wasn't obvious to whoever reads this answer. This should work, but, it wipes all project metadata. So it is best to **remove the projects from your workspace first** and re-import them aftwards. Doing this with the projects in the workspace may confuse Eclipse and Eclipse will then recreate some empty / vanilla .project files, leaving you basically again with a 'bogus' .project file to deal with. – Kris Nov 19 '18 at 17:25
  • I've updated the answer to make that point more clear -- thanks, @Kris. – Jan Nielsen Dec 14 '18 at 17:06
  • Answer is not clear. What do you mean by delete the project in STS? – The Guest Mar 13 '19 at 18:16
  • "Delete the project" -> right click on project, select delete. – Jan Nielsen Mar 13 '19 at 19:19
2

I saw this problem after installing Eclipse Jee-2019-03 and using it for a workspace created by Eclipse Oxygen.

My answer is similar to Amadán, but I did not see Spring in the right-click dropdown of the project... because I has not installed the Spring tools yet.

I did this: Right-click on the project --> Properties --> Project Natures
click on springnature --> Remove
click Help --> Eclipse Marketplace...
Find: Spring --> click Go
on the Spring Tools 4 - for Spring Boot --> click Install

after that my project worked and I did not have to add springnature to the Project Natures

PMorganCA
  • 598
  • 5
  • 22
1

You might also try to just:

  1. remove the Spring nature
    • right click on the project > Spring > Remove Spring Project Nature
  2. add the Spring nature again
    • right click on the project > Spring > Add Spring Project Nature
Amadán
  • 663
  • 5
  • 15