如何通过命令行启动弹簧启动应用程序?
2022-08-31 09:26:57
我有一个弹簧引导应用程序,我需要通过转到文件夹目录并通过命令行启动我的Web应用程序来启动该应用程序。我有一个名为 Application 的类.java其中的代码如下所示。
@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);
}
}
我设置了类路径,然后尝试运行命令“”,但我收到此错误消息”java ApplicationUtility
Could not find the main class: ApplicationUtility. Program will exist.
"