Finished with non-zero exit value 1

Hi guys, I just started learning gradle and I have a problem with gradle execute. Crash on: Process ‘command ‘C:\Program Files\Java\jdk1.8.0_92\bin\java.exe’’ finished with non-zero exit value 1. Please tell me how to fix it.

build.gradle:

apply plugin: "java"

task execute(type: JavaExec) {
	main = "com.person.ilya"
	classpath = sourceSets.main.runtimeClasspath
}

Git Bash command line:

Илья ilya $ gradle execute
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:executeError: Could not find or load main class com.person.ilya
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':execute'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_92\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.

BUILD FAILED

Total time: 1.062 secs

Before it ran: gradle assemble:

Илья ilya $ gradle assemble
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE

BUILD SUCCESSFUL

Total time: 0.987 secs

However It does not create an src directory and java files.

1 Like

I have the same.

Do you find solution please ?