[SpringBoot] Spring-Boot: Run command Starts an error, unable to find a suitable main class, please add a ‘mainclass’


Use Maven command Spring-Boot: Run Start the SpringBoot project to report an error:

Unable to find a suitable main class, please add a ‘mainClass’ property

First of all, I can determine that I have no mistake. I can start the project through the Java class, but the Spring-Boot: RUN command cannot start the project.

1 First, add the POM configuration file plug -in setting according to the online suggestion:

                <!-Add the following->

I have no effect after trying it

2 first start the SpringBoot project through the Java class

public class App {
    public static void main(String[] args) {
        SpringApplication.run(App.class, args);

can be successfully started and keep starting status

execute Spring-Boot: Run command starts, the Spring icon will appear, but the error will be reported afterwards
At this time, turn off the threads startup of the Java class, and then execute the Spring-Boot: Run command to start.

This is how I started this.


Random Posts

Detailed explanation of the implementation of Call, Apply, and Bind in JS (source code implementation)

STM32CUBEMX+Keil+HAL Library (DMA+idle interruption and sending and receiving indefinite data) CZU

1 1 2 2330-Final Ugly English [Stack] PULLULATE

Solving the bug of IE6 IE7 onResize

-like pressure DP seeks the shortest road