close

[Solved] How to solve could not find or load main class error with spring boot?

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error How to solve could not find or load main class error with spring boot? in java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How How to solve could not find or load main class error with spring boot Error Occurs?

Today I get the following error How to solve could not find or load main class error with spring boot? in java.

How To Solve How to solve could not find or load main class error with spring boot Error ?

  1. How To Solve How to solve could not find or load main class error with spring boot Error ?

    To Solve How to solve could not find or load main class error with spring boot Error In case if someone is using Gradle for the build then fix will be by adding the following lines in build.gradle file

  2. How to solve could not find or load main class error with spring boot?

    To Solve How to solve could not find or load main class error with spring boot Error In case if someone is using Gradle for the build then fix will be by adding the following lines in build.gradle file

Solution 1

Main class is configurable in pom.xml

<properties>
    <start-class>com.bt.collab.alu.api.webapp.Application</start-class>
</properties>

Solution 2

In case if someone is using Gradle for the build then fix will be by adding the following lines in build.gradle file

apply plugin: 'application'

mainClassName = "com.example.demo.DemoApplication"

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment