[英]Process 'command 'C:\Program Files\Java\jdk1.8.0_25\bin\java.exe'' finished with non-zero exit value 2
[英]Process 'command 'C:/Java/jdk8/bin/java.exe'' finished with non-zero exit value 1
今天当我使用 Spring Boot 重新启动我的应用程序时,控制台提示
Execution failed for task ':Application.main()'.
> Process 'command 'C:/Java/jdk8/bin/java.exe'' finished with non-zero exit value 1
我不知道如何解决这个问题
这是我的application.java
和application.yaml
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
server:
port: 80
Spring Boot 和 Gradle 的版本是 2.3.7.RELEASE 和 6.1.1
有任何想法吗?
好的,我已经解决了这个问题,我会分享给你。
在 gradle 缓存文件中,我发现了一些类似下面的日志
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded
datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
FAILURE: Build failed with an exception.
这个问题是我没有一些用于 SpringBoot 启动的数据库配置。 所以当我在资源文件夹中添加数据库配置并创建一个application.yaml文件时,启动成功。
就是这样,也许下次我们可以先添加配置文件,或者我们可以自己配置日志。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.