首页 > 其他分享 >SpringBoot启动类变灰色,无法启动,注解通通不生效

SpringBoot启动类变灰色,无法启动,注解通通不生效

时间:2023-07-18 12:14:31浏览次数:32  
标签:java SpringBoot 启动 类变 Maven 注解

1:自己准备创建SpringBoot项目时,严格按照要求创建后,变成了这样。启动类运行不了,@SpringBootApplication注解也是黑色。而正常的是蓝色,注解是黄色。

2:通过查询博主java文件夹标记为sources root目录,右上角选择蓝色框框,然后选择Modules,最后把java、resources、test分别配置好。 

 3:此时我们看到文件颜色已经变正常了,但是仍然报错,无法识别注解等等

 

4.最终解决方案
选择项目的pom文件,选中右键选择 Add as Maven Project
选项,将其作为Maven项目添加

 

-------------如果上述方法还解决不了问题:

 

标签:java,SpringBoot,启动,类变,Maven,注解
From: https://www.cnblogs.com/liyanxi/p/17562544.html

相关文章

  • IDEA 启动报错:Error running 'DemoApplication': Command line is too long. Shorten
     IDEA启动报错:Errorrunning'DemoApplication':Commandlineistoolong.ShortencommandlineforDemoApplicationoralsoforSpringBootdefaultconfiguration. 修改 打开 修改成  然后在重新启动即可......
  • vue前端项目启动
    我们拉取了一个前端项目后,如果项目中有说明的文档,可以参照文档的步骤启动项目,如果项目中没有说明文档,那我们可以按照以下的步骤启动项目1、首先是安装依赖包npminstall 2、启动项目npmrundev这里的npmrun环境名称,这里的环境名称主要取决于项目中的package.json文件中......
  • OCS无法启动,api-ms-win-crt-runtime-l1-1-0.dll丢失
    简介:win7sp1vl版,安装ocsagent2.10后无法打开,提示api-ms-win-crt-runtime-l1-1-0.dll丢失一:VC经查是VC2015没有安装。二:下载DownloadVisualC++RedistributableforVisualStudio2015fromOfficialMicrosoftDownloadCenter根据系统版本装一下,重启即可解决问题。......
  • 如何重置/重新启动PCIe设备
    其中DDDD.BB.DD.F= Domain:Bus:Device.Function方法一:1.首先移除pcie设备echo1>/sys/bus/pci/devices/AAAA:BB:CC.D/remove其中AAAA:BB:CC.D为bus-info,意思分别为Domain:Bus:Device.Function2.重新添加pcie设备echo1>/sys/bus/pci/rescan方法二:直接reset对应的pci......
  • 在树莓派启动分区创建配置文件,使其加入无线网络
    在树莓派的启动分区创建一个名为“wpa_supplicant.conf”配置文件,在文件中输入以下内容:country=CNctrl_interface=DIR=/var/run/wpa_supplicantGROUP=netdevupdate_config=1network={ssid="xxx"psk="xxx"priority=5}ssid:指定要连接的无线网络psk:网络......
  • SpringBoot官方笔记4Web
    Mostwebapplicationsusethe spring-boot-starter-web moduletogetupandrunningquickly.Youcanalsochoosetobuildreactivewebapplicationsbyusingthe spring-boot-starter-webflux module.ServletWebApplicationsSpringWebMVCFrameworkimportja......
  • SpringBoot官方笔记3核心
    SpringApplicationBydefault, INFO loggingmessagesareshown,includingsomerelevantstartupdetails,suchastheuserthatlaunchedtheapplication.LazyInitializationWhenlazyinitializationisenabled,beansarecreatedastheyareneededratherth......
  • SpringBoot官方笔记7IO
    CachingSpringBootauto-configuresthecacheinfrastructureaslongascachingsupportisenabledbyusingthe @EnableCaching annotation.importorg.springframework.cache.annotation.Cacheable;importorg.springframework.stereotype.Component;@Component......
  • SpringBoot官方笔记6消息
    TheSpringFrameworkprovidesextensivesupportforintegratingwithmessagingsystems,fromsimplifieduseoftheJMSAPIusing JmsTemplate toacompleteinfrastructuretoreceivemessagesasynchronously.SpringAMQPprovidesasimilarfeaturesetforth......
  • SpringBoot官方笔记5Data
    SpringBootintegrateswithanumberofdatatechnologies,bothSQLandNoSQL.SQLDatabasesSpringData providesanadditionalleveloffunctionality:creating Repository implementationsdirectlyfrominterfacesandusingconventionstogeneratequeries......