Skip to content
Advertisement

How to start up spring-boot application via command line?

I have a spring-boot application which I need to start up by going to the folder directory and start up my web application via command line. I have a class called Application.java and the code inside it is as followed.

JavaScript

I set up classpath then tried to run the command “java ApplicationUtility” but I’m getting this error message “Could not find the main class: ApplicationUtility. Program will exist.

Advertisement

Answer

You will need to build the jar file first. Here is the syntax to run the main class from a jar file.

JavaScript
Advertisement