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
请先登录再写评论。
Does clearing caches help? (File | Invalidate caches and restart)?
tried that... doesn't work... (quite a few times.)
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).
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.
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.
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:
You can share the logs via https://uploads.jetbrains.com.
Uploaded ZIP-file as 2021_11_15_5krpwHahe3EkXPSW
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?
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/.