Spring-Boot main class not found

Main class not found at runtime

When I tried to start the Spring-Boot project imported from git, the following error sometimes appeared.

** Error: Main class com.example.Hoge was not found or could not be loaded **

Cause

The causes reproduced here are as follows.

This method will result in an error that cannot be found. Also, clean build or Maven update on the imported project does not solve the problem.

Correspondence

When I imported the project from STS by the following method, it started normally.

After this, it started normally (by habitually performing Maven update and clean build). For memorandum & reference.

Recommended Posts

Spring-Boot main class not found
HttpServletRequest class file not found
Error: Main class not found or could not be loaded
[Java] Main class XXX was not found or could not be loaded
java.util.Optional class and null and not null
Today's java error: Error: Could not find or load main class
If macOS Catalina says "Error: Main class XX was not found or could not be loaded"
"Error: Main class XXX not found or could not be loaded" occurs even though the main class exists
Symbol not found error when new class in another Java file
ld: framework not found Crashlytics workaround
Error in ./gradlew: Symbol not found
"Selection does not include main type"