【问题标题】:Why this error "Could not find or load main class" appears when I execute the main class in a spring boot project in eclipse为什么当我在eclipse的spring boot项目中执行主类时出现这个错误“找不到或加载主类”
【发布时间】:2021-06-16 15:35:14
【问题描述】:
大家好,当我在 Eclipse 中执行 Spring Boot 项目的主类(作为应用程序)时出现此错误:
错误:无法找到或加载主类
com.aymen.StockManagement.ApiStockManagementApplication 原因:
java.lang.ClassNotFoundException:
com.aymen.StockManagement.ApiStockManagementApplication
希望有人能帮我解决这个问题
【问题讨论】:
标签:
java
eclipse
spring-boot
【解决方案1】:
您的 pom.xml 中是否有可能缺少此位?
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>