Spring Boot Application in default package

简介: Spring Boot Application in default package

本文讲述了作者在编程时遇到的一个错误,问题出在使用Application写的引导类,必须确保该类文件与相关代码在同一文件夹下,否则会导致编译错误。

摘要由CSDN通过智能技术生成

1、今天在敲代码爆了一个错误:

2、这里出现问题,导致的原因,利用Application写的引导类,必须在同一个文件夹下,才不会报错


相关文章
|
3月前
|
Java Spring
idea新建spring boot 项目右键无package及java类的选项
idea新建spring boot 项目右键无package及java类的选项
103 5
|
4月前
|
缓存 Java Maven
Spring Boot 启动错误:To display the conditions report re-run your application with ‘debug‘ enable —【已解决】
Spring Boot 启动错误:To display the conditions report re-run your application with ‘debug‘ enable —【已解决】
368 1
|
12月前
|
Java Spring
Command line is too long. Shorten command line for Application or also for Spring Boot default confi
Command line is too long. Shorten command line for Application or also for Spring Boot default confi
31 1
|
5月前
|
Java Linux Windows
windows解决SpringBoot启动时:APPLICATION FAILED TO START
windows解决SpringBoot启动时:APPLICATION FAILED TO START
122 0
|
11月前
|
Java Spring
Spring Boot 启动报错解决:No active profile set, falling back to default profiles: default
Spring Boot 启动报错解决:No active profile set, falling back to default profiles: default
298 0
|
12月前
|
Java
【异常】SpringBoot报错Command line is too long.Shorten command line for Application or also for Applicatio
【异常】SpringBoot报错Command line is too long.Shorten command line for Application or also for Applicatio
218 0
|
6天前
|
SQL 监控 druid
springboot-druid数据源的配置方式及配置后台监控-自定义和导入stater(推荐-简单方便使用)两种方式配置druid数据源
这篇文章介绍了如何在Spring Boot项目中配置和监控Druid数据源,包括自定义配置和使用Spring Boot Starter两种方法。
|
Java 数据库连接 Spring
Spring Application Event Example
Spring Application Event 项目结构 工程下载 https://github.com/xiaoheike/SpringApplicationEventExample.git SportEvent package nd.
751 0
|
2月前
|
缓存 Java Maven
Java本地高性能缓存实践问题之SpringBoot中引入Caffeine作为缓存库的问题如何解决
Java本地高性能缓存实践问题之SpringBoot中引入Caffeine作为缓存库的问题如何解决
|
3月前
|
Java 测试技术 数据库
Spring Boot中的项目属性配置
本节课主要讲解了 Spring Boot 中如何在业务代码中读取相关配置,包括单一配置和多个配置项,在微服务中,这种情况非常常见,往往会有很多其他微服务需要调用,所以封装一个配置类来接收这些配置是个很好的处理方式。除此之外,例如数据库相关的连接参数等等,也可以放到一个配置类中,其他遇到类似的场景,都可以这么处理。最后介绍了开发环境和生产环境配置的快速切换方式,省去了项目部署时,诸多配置信息的修改。
下一篇
无影云桌面