Spring Boot Error: The main class could not be found or could not be loaded

Source: Internet
Author: User

One: The problem occurs when you start the Spring boot project in eclipse:

Springboot Error: The main class could not be found or could not be loaded

Workaround:

1, through the cmd command line, into the project directory, mvn clean install to compile

After the project is install, select the project on Eclipse and press F5 to refresh the project. Run again to solve the problem.

2, select the project on Eclipse

Click the Clean cleanup project and then run the problem resolution.

3, if the main class cannot be loaded if it is running or occurs,

(a) If there is a problem with the project code,

(b) can enter CMD, CD into the project directory

Execute command:

MVN Clean Compile

MVN Install

MVN Spring-boot:run

The above three commands are compiled and started.

Note: Use the cmd command to start the JDK environment to configure the MAVEN environment.

The Eclipse startup and CMD commands start the normal interface separately as:

(Eclipse startup will not be able to read article one). Eclipse Startup and cmd command start to separate or port conflicts, modify the boot port inside the source has.

Spring Boot Error: The main class could not be found or could not be loaded

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.