Spring Boot程序找不到main类 [英] Spring Boot Program cannot find main class

查看:501
本文介绍了Spring Boot程序找不到main类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序在Eclipse中作为一个Spring启动应用程序运行。程序运行正常。然后我做了以下:



右键单击项目 - >运行方式 - > Maven测试。



是偶然的当我再次尝试运行该程序作为一个弹出启动应用程序,它在下面抛出以下错误。



错误:找不到或加载主类com.bt.collab.alu.api.webapp.Application



我如何将应用程序指向我的主要课程?
感谢

解决方案

主类可在pom.xml中配置

 <性状> 
< start-class> com.bt.collab.alu.api.webapp.Application< / start-class>
< / properties>


I have a program which runs as a Spring boot App in eclipse. The program was running fine. Then i did the following:

Right click on project -> Run As -> Maven Test .

This was accidental. When i then tried to run the program as a spring boot app again, it threw the following error below.

Error: Could not find or load main class com.bt.collab.alu.api.webapp.Application

How do i point the application back to my main class? Thanks

解决方案

Main class is configurable in pom.xml

<properties>
    <start-class>com.bt.collab.alu.api.webapp.Application</start-class>
</properties>

这篇关于Spring Boot程序找不到main类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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