Spring boot project imported in intellij not working

Viewed 31355

I have imported spring boot project generated from spring boot initialiazr website and the project spring boot packages are not found.

Please seee the image below

Image error from intellij

Please help

9 Answers

I tried this and it worked, "Right click on the pom.xml file", and select "Add as maven project"

It should resolve or reimport all the dependencies, and it should work.

I downloaded a simple project from Spring IO . But Intellij Idea could not import it properly. Somethings were wrong. It had been seem like it could not understand it is maven project. I changed Maven home path from "Use maven wrapper" to "Bundled" in File | Settings | Build, Execution, Deployment | Build Tools | Maven. And it re-initiate the project and it downloaded the dependencies. screenshot of settings

I had the same issue and the following worked for me

  1. Delete the .idea folder inside the project
  2. Then add the Java SDK for your project In IntelliJ Idea: File --> Project Structure --> Project SDK add the Java SKD -->OK
  3. Next you have to restart the IntelliJ Idea

I realize this is an old question, but just in case it helps someone else:

If you have more than one Java sdk installed you need to specify the java version you want to use before you can rebuild.

In IntelliJ Idea: File --> Project Structure --> Project Select your Project SDK, then rebuild the project

that worked for me...

I used this way: I created 2 folders in documents for exemple : MyProject -> Project ... before opening your folder you should choose "Project" as I write. The problem is choosing wrong main folder

I recently faced this issue after use IntelliJ IDED after few months.

When import project with existing source files or new which download from spring initializr, we should click open project. Should not use new project.

Hardly I wasted 1 day time to display hello world text using spring boot rest get api call.

For Spring Initializer Project,

  1. Extract downloaded zip file from https://start.spring.io in corresponding folder.
  2. Open intelliJIdea application, you can reach "Welcome To IntelliJIdea" displaying with recent projects.
  3. Click Open in the top right side of the same window. Select desired folder path of the project and continue the steps.
  4. Hope now you can run project without "Springbootapplication not found" error
Related