Spring boot project imported in intellij not working
Asked Answered
L

9

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

Lepidolite answered 17/7, 2017 at 13:54 Comment(0)
L
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>
Lepidolite answered 17/7, 2017 at 16:37 Comment(1)
If you use proxy, you better use ProxifierReconnoiter
S
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.

Suribachi answered 5/7, 2018 at 0:34 Comment(1)
In our case we were missing <version></version> tags in our pom.xml and it correctly imported afterPyrophotometer
T
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.

Tweeny answered 17/7, 2017 at 14:15 Comment(1)
I did as you said but nothing happen. I have internet connexion in my machin.Lepidolite
L
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>
Lepidolite answered 17/7, 2017 at 16:37 Comment(1)
If you use proxy, you better use ProxifierReconnoiter
R
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

Rave answered 14/6, 2022 at 19:6 Comment(0)
W
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

Wallas answered 17/7, 2017 at 14:0 Comment(2)
I did as you suggested but nothing happen. Please take a look at my question edited.Lepidolite
Even when I create spring boot project from intellij using spring boot initializr. I got same problem.Lepidolite
C
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
Condon answered 30/12, 2020 at 3:0 Comment(0)
I
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...

Indisposed answered 17/10, 2019 at 15:55 Comment(0)
U
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

Underlie answered 8/5, 2021 at 12:12 Comment(1)
The wording of your answer does not make it completely clear where one should click/open. Is Project a subfolder of MyProject?Felon
S
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
Switcheroo answered 24/10, 2021 at 2:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.