簡體   English   中英

Process 'command 'C:/Java/jdk8/bin/java.exe'' 以非零退出值 1 結束

[英]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.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文件時,啟動成功。

就是這樣,也許下次我們可以先添加配置文件,或者我們可以自己配置日志。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM