微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

进程'命令'C:/Java/jdk8/bin/java.exe'' 以非零退出值 1 结束

如何解决进程'命令'C:/Java/jdk8/bin/java.exe'' 以非零退出值 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.javaapplication.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 文件时,然后启动成功。

就这样吧,也许下次我们可以先添加配置文件或者我们自己配置日志。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。