最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

gradle - .jdkscorretto-1.8.0_422binjava.exe'' finished with non-zero exit value 1 - Stack Overflow

programmeradmin0浏览0评论

I have an issue if I try to start my gradle project. This is my Gradle file:

group 'eresult'
version '1.0-SNAPSHOT'

buildscript {

    repositories {
        mavenCentral()
    }
    dependencies{
        classpath(".springframework.boot:spring-boot-gradle-plugin:1.5.10.RELEASE")


    }
}

apply plugin: "java"
println "Gradle "+gradle.gradleVersion
apply plugin: '.springframework.boot'

jar {
    manifest {
        attributes(
                'Main-Class': 'it.eresult.Application'
        )
    }
}
sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile (".springframework.boot:spring-boot-starter-web")
    compile group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '7.2.0.jre8'
    compile 'com.google.code.gson:gson:2.8.6'
}

This is the configuration of my IntelliJ settings:

This is the configuration to start the application:

If I try to start the application, I can see the following error:

> Task :it.eresult.Application.main() FAILED

Execution failed for task ':it.eresult.Application.main()'.
> Process 'command 'C:/Users/michele.castriotta/.jdks/corretto-1.8.0_422/bin/java.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

How can I fixed it?

I have an issue if I try to start my gradle project. This is my Gradle file:

group 'eresult'
version '1.0-SNAPSHOT'

buildscript {

    repositories {
        mavenCentral()
    }
    dependencies{
        classpath(".springframework.boot:spring-boot-gradle-plugin:1.5.10.RELEASE")


    }
}

apply plugin: "java"
println "Gradle "+gradle.gradleVersion
apply plugin: '.springframework.boot'

jar {
    manifest {
        attributes(
                'Main-Class': 'it.eresult.Application'
        )
    }
}
sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile (".springframework.boot:spring-boot-starter-web")
    compile group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '7.2.0.jre8'
    compile 'com.google.code.gson:gson:2.8.6'
}

This is the configuration of my IntelliJ settings:

This is the configuration to start the application:

If I try to start the application, I can see the following error:

> Task :it.eresult.Application.main() FAILED

Execution failed for task ':it.eresult.Application.main()'.
> Process 'command 'C:/Users/michele.castriotta/.jdks/corretto-1.8.0_422/bin/java.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

How can I fixed it?

Share Improve this question asked Mar 13 at 9:17 bircastribircastri 2,16714 gold badges55 silver badges132 bronze badges 5
  • Why not follow the advice shown in the error message? – g00se Commented Mar 13 at 9:28
  • (1) Your Gradle content is too old. It is recommended that you use start.spring.io to generate a Spring Boot Gradle example. (2) The Spring Boot Gradle example set Spring Boot 3.x.x requires JDK to be JDK 17+. (3) If you can only use JDK 1.8, then the Spring Boot version must be 2.x.x.You can modify the spring boot version in the example build.gradle to 2.x.x. – life888888 Commented Mar 13 at 9:28
  • @life888888 I don't understand what can I change in my build.gradle file – bircastri Commented Mar 13 at 11:30
  • First of all, do you have any special restrictions? Is JDK limited to JDK 1.8? Does Spring Boot have a special version requirement? Do you accept JDK 17 + Spring Boot 3.x? and Gradle version 8.x ? – life888888 Commented Mar 13 at 11:50
  • Yes I can also upgrade my project. Could you support me to upgrade the project? – bircastri Commented Mar 13 at 13:34
Add a comment  | 

1 Answer 1

Reset to default 0

It looks like you are simply trying to run your program and there is a runtime exception within it, but you are not on the correct view in the IDE to see what it is.

I wrote another answer to someone with the same problem which describes where exactly to look in IntelliJ for the runtime exception.

发布评论

评论列表(0)

  1. 暂无评论