SpringBoot: Unable to find a single main class from the following candidates

后端 未结 11 1881
旧巷少年郎
旧巷少年郎 2020-12-13 00:06

I\'ve generated a Spring Boot web application using Spring Initializer, embedded Tomcat, Thymeleaf template engine.Technologies used: Spring Boot 1.4.2.RELEASE, Spring 4.3.4

11条回答
  •  既然无缘
    2020-12-13 00:44

    Check your application if you have multiple classes with public static void main(String[] args). Remove the one that you do not need. Specially if you generate the project with https://start.spring.io/ it comes with a class with main method in it.

    If you do need all of the classes with main method just explicitly mention which one would to be boos-trapped up on application start up by mentioning it in the pom.

提交回复
热议问题