Error:(3, 32) java: package org.springframework.boot does not exist

已回答

A fresh off the tree barebones springboot project doesn't work.

and the same thing works from the command line.

 

I also have a sample project (it is barebones...) this problem has been cropping up more frequent that i would like.

I have seen some similiar issues, need help with this

4

Does clearing caches help? (File | Invalidate caches and restart)? 

0

tried that... doesn't work... (quite a few times.)

0

In the ticket you mentioned that reinstalling IntelliJ IDEA helps. 

Let me know if the issue occurs in the future. We could narrow down this by deleting system directories one by one (plugins, caches, settings etc).

0

I've seen this every time I use Spring Initializr for Gradle, unzip the ZIP-file and then tell IntelliJ to import the project from existing sources. I can use ./gradlew in a window but not the IntelliJ build (or other analysis) commands.

0

Gradle import seems to fail on your system for some reason. Please report at https://youtrack.jetbrains.com/newIssue?project=IDEA with the logs attached via Help | Collect Logs and Diagnostic Data. We can't reproduce this issue.

0

Whenever I download the 7.9 MB ZIP-file log, it says server down/overloaded. Here's what I've written exclusive of the log:

What steps will reproduce the issue?
1. Follow the steps at https://spring.io/quickstart, selecting Java 11 and Gradle as directed.
2. Notice that a copy/paste of the demo program does not recognize the Spring imports, but the gradlew script can compile and run it.
What is the expected result?

All Spring-related import statements recognized.

What happens instead?

Please attach the IDE logs to the issue. You can get them by selecting Collect Logs and Diagnostic Data from the Help menu. -- DONE

If possible, please attach a code sample, screenshot, or screencast that illustrates the problem. -- SAMPLE CODE FROM WEBSITE ABOVE

To make the issue visible only to the JetBrains team, you can set its visibility to the jetbrains-team group. With the exception of images, all attachments are visible only to the JetBrains team by default.

If you can’t provide IDE logs, please provide information about the IDE version and the OS you are using. You can copy these details from the About dialog in the Help or App menu.

NOTE: I do not have GRADLE_USER_HOME or USER_HOME set.

0

Uploaded ZIP-file as 2021_11_15_5krpwHahe3EkXPSW

0

Please try with the default IDE settings (File | Manage IDE Settings | Restore Default Settings...: https://i.imgur.com/kbrkC7w.png) and no third-party plug-ins. Delete .idea directory in the project directory and reimport the project from build.gradle.

Do you see Spring libraries under the External Libraries node of the project view? Can you browse inside the jars there and see the classes that are shown in red in the editor?

0

Just restoring default settings did not work. Next step was to quit IntelliJ and delete .idea/ in project. After starting up again, it works. Note that all third-party plugins were never disabled. Then went to another project that had been similarly "broken" w.r.t. Spring import statements. Still broken. Quit IntelliJ, deleted .idea/, restarted IntelliJ -- it now works.

There's a "bug" in the .idea directory?. Recreating the springmicro (as demo2) project now that system is back to default configuration. It works. Suspect something in the non-default IntelliJ configuration caused problem with .idea/.

0

请先登录再写评论。