无法解析符号@SpringBootApplication-IntelliJ DEA [英] Cannot Resolve Symbol @SpringBootApplication - IntelliJ DEA

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

问题描述

我将Spring Initializr构建导入IntelliJ,然后将其作为Spring Boot构建运行. 构建工作正常并在浏览器中显示,但是我继续收到有关未使用导入的错误,并且@SpringBootApplication无法解析.我还遵循了以下步骤:无法解析符号SpringApplication

I imported a Spring Initializr build to IntelliJ and then run it as a Spring Boot build. The build works fine and displays in the browser but I continue to receive an error about unused imports and that @SpringBootApplication cannot be resolved. I also followed these steps as well: Cannot resolve symbol SpringApplication

其他任何人都有这个问题.

Anyone else has this issue.

package com.sts.kevthedev;

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

@SpringBootApplication
public class KevthedevApplication {

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

推荐答案

尝试一下:
文件-> 使缓存无效/重新启动-> 使无效并重新启动

Try it:
File -> Invalidate Caches/Restart -> Invalidate And Restart

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

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