IntelliJ:无法解析符号"springframework" [英] IntelliJ: Cannot resolve symbol 'springframework'

查看:494
本文介绍了IntelliJ:无法解析符号"springframework"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Spring开始我的第一个项目.我使用IntelliJ想法,我对此也很陌生.但是无论如何,我遵循了Jetbrains网站上写的步骤,我不知道做错了什么,但是对于默认情况下创建的文件,我首先遇到了很多错误.

I'm trying to start my first project with Spring. I use IntelliJ idea and I'm kind of new to it too. But anyways, I followed the step written on the Jetbrains website and I don't know what I have done wrong, but I got a lot of errors on the first to files that are created by default.

BloomBookingApplcation.java

BloomBookingApplcation.java

package com.bloombooking;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class BloomBookingApplication {

    public static void main(String[] args) {
        SpringApplication.run(BloomBookingApplication.class, args);
    }
}

Error:(3, 12) Cannot resolve symbol 'springframework'
Error:(4, 12) Cannot resolve symbol 'springframework'
Error:(6, 2) Cannot resolve symbol 'SpringBootApplication'
Warning:(7, 1) Access can be packageLocal
Error:(9, 26) Cannot resolve symbol 'String'
Error:(10, 3) Cannot resolve symbol 'SpringApplication'

也许我很愚蠢,但我不知道我错过了哪一步...

Maybe I'm stupid but I don't know which step I've missed...

我该如何解决?

我已经找到了使用quickfix按钮添加spring的方法.

I have found the way to add spring with the quickfix button.

但是现在我遇到了新的错误,我不明白为什么...也许应该直接下载它,然后将库一个接一个地放置?

But now I have got new errors I don't understand why... I should maybe download it directly and put the libraries one by one maybe?

Error:(3, 28) Cannot resolve symbol 'boot'
Error:(4, 28) Cannot resolve symbol 'boot'
Error:(6, 2) Cannot resolve symbol 'SpringBootApplication'
Warning:(7, 1) Access can be packageLocal
Error:(9, 26) Cannot resolve symbol 'String'
Error:(10, 3) Cannot resolve symbol 'SpringApplication'

或者可能是我的IntelliJ想法没有正确配置,因为我在任何地方都没有完成,并且无法创建包...

Or maybe it's my IntelliJ idea which isn't configured right since I don't have any completion anywhere and I can't create packages...

推荐答案

单击刷新按钮.Maven可能无法正确同步

Click on refresh button .Maven may not be able to sync properly

这篇关于IntelliJ:无法解析符号"springframework"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆