14

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 9

18

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.

1
  • In our case we were missing <version></version> tags in our pom.xml and it correctly imported after Commented Feb 26, 2021 at 20:12
8

You need to download libraries so right click project, go to "Maven" option in menu then click "ReImport" or "Download Sources and Documentation" option in sub menu. It will download libraries.

1
  • 1
    I did as you said but nothing happen. I have internet connexion in my machin. Commented Jul 17, 2017 at 14:24
5

My problem is fixed. It was my proxy settings problem. I made right clic on IntelliJ=>Maven=>Open Settings.xml

I update settings xml file by adding

<proxies>
        <proxy>
            <id>myproxy</id>
            <active>true</active>
            <protocol>http</protocol>
            <host>myproxyhost</host>
            <port>myproxyportnumber</port>
            <username>myproxyusername</username>
            <password>myproxpass</password>
            <nonProxyHosts>*.google.com|ibiblio.org</nonProxyHosts>
        </proxy>
 </proxies>
1
  • If you use proxy, you better use Proxifier
    – user8389458
    Commented Feb 28, 2018 at 11:16
4

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

2

You need to download all of the spring-boot dependencies, and because I see pom.xml in your project I assume you're using Maven as build tools. In order to download the dependencies you can execute command mvn clean install on your command line.

I'm sorry I'm not very familiar with Intellij, but you can also execute Maven command in Intellij you can check the documentation

2
  • I did as you suggested but nothing happen. Please take a look at my question edited. Commented Jul 17, 2017 at 14:26
  • Even when I create spring boot project from intellij using spring boot initializr. I got same problem. Commented Jul 17, 2017 at 14:29
1

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
0

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...

0

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

1
  • The wording of your answer does not make it completely clear where one should click/open. Is Project a subfolder of MyProject? Commented May 8, 2021 at 12:51
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.