user4900074 :
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.
@SpringBootApplication(scanBasePackages = {"com.ubs.tas.topcat.dashboard"})
public class Application extends SpringBootServletInitializer {
private static final Logger LOGGER = LoggerFactory.getLogger(Application.class.getName());
private static final Class<Application> applicationClass = Application.class;
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(applicationClass);
}
public static void main(String[] args) {
LOGGER.info("Starting...");
SpringApplication.run(Application.class, args);
}
}
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.
"
Srikanth Anusuri :
You will need to build the jar file first. Here is the syntax to run the main class from a jar file.
java -jar path/to/your/jarfile.jar fully.qualified.package.Application
Guess you like
Origin http://10.200.1.11:23101/article/api/json?id=428112&siteId=1