解决方案:测试包名和项目启动主类的包名必须一致
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @Sp


关于No compiler is provided in this environment. Perhaps you are running
on a JRE rather than JDK?处理【替换为自己的jdk位置】

<!--start-->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<fork>true</fork>
<executable>
C:\Program Files\Java\jdk1.8.0_131\bin\javac.exe
</executable>
</configuration>
</plugin>
<!--end-->
这篇博客主要讨论了两个常见的开发问题:一是Spring Boot应用启动失败,原因是测试包名与项目启动主类的包名不一致,解决办法是确保两者匹配;二是遇到了'No compiler is provided in this environment'的错误,这通常是因为运行的是JRE而非JDK。解决方案是配置maven-compiler-plugin插件,明确指定JDK的javac.exe路径。
641

被折叠的 条评论
为什么被折叠?



