Gradle - Could not find or load main class

前端 未结 13 773
星月不相逢
星月不相逢 2020-11-29 06:51

I\'m trying to run a very simple project using Gradle and running into the following error when using the gradlew run command:

could not find or l

相关标签:
13条回答
  • 2020-11-29 07:51

    In my build.gradle, I resolved this issue by creating a task and then specifying the "mainClassName" as follows:

    task(runSimpleXYZProgram, group: 'algorithms', description: 'Description of what your program does', dependsOn: 'classes', type: JavaExec) {
        mainClassName = 'your.entire.package.classContainingYourMainMethod'
    }
    
    0 讨论(0)
提交回复
热议问题