gpt4 book ai didi

java - 任务 ':run'的执行失败。 >流程'命令...以非零退出值1完成

转载 作者:行者123 更新时间:2023-12-03 06:25:08 25 4
gpt4 key购买 nike

不知道我的build.gradle文件出了什么问题。我是gradle的新手,所以我不理解错误。它允许我运行gradle build,gradle init,gradle任务等,但是当我运行“gradle run”时构建失败

screenshot of my command line

这是我的build.gradle:

 plugins {
id 'com.github.spotbugs' version '1.6.5'
}

apply plugin: 'application'

///////////////////////////////////////////////////////////////////////////
// Definint Main class
///////////////////////////////////////////////////////////////////////////
mainClassName = 'main.java.main'


repositories {
mavenCentral()
}
dependencies {
compile "junit:junit:4.12"

}



///////////////////////////////////////////////////////////////////////////
// Configure Checkstyle
///////////////////////////////////////////////////////////////////////////
apply plugin: 'checkstyle'
checkstyle {
// Keep checkstyle a little quieter
ignoreFailures = true
showViolations = false
}

tasks.withType(Checkstyle) {
reports {
html.enabled = true
xml.enabled = false
}
}
checkstyle {
toolVersion = "8.8"
}


///////////////////////////////////////////////////////////////////////////
// Configure SpotBugs
///////////////////////////////////////////////////////////////////////////

// The part below needs to be included for Spotbugs
spotbugs {
toolVersion = '3.1.1'
}

// // To generate an HTML report instead of XML
tasks.withType(com.github.spotbugs.SpotBugsTask) {
reports {
xml.enabled = false
html.enabled = true
}
}

最佳答案

您已将主要类(class)设置为
mainClassName = 'main.java.main'
检查这是否正确。该值应该是主类的完全限定名称,即包含main()方法的类。

关于java - 任务 ':run'的执行失败。 >流程'命令...以非零退出值1完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53491931/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com