Reputation: 13342
I try do build my Java project with Gradle
and I'm getting the following:
Starting Build
Settings evaluated using settings file 'C:\Users\MyName\Java8\MyJavaProject\settings.gradle'.
Projects loaded. Root project using build file 'C:\Users\MyName\Java8\MyJavaProject\build.gradle'.
Included projects: [root project 'MyJavaProject']
Evaluating root project 'MyJavaProject' using build file 'C:\Users\MyName\Java8\MyJavaProject\build.gradle'.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\MyName\Java8\MyJavaProject\build.gradle' line: 25
* What went wrong:
A problem occurred evaluating root project 'MyJavaProject'.
> Could not find property 'myJavaPackage' on root project 'MyJavaProject'.
Line 25 of build.gradle
: mainClassName = myJavaPackage.runner.MainRunner
In settings.gradle
I have: rootProject.name = 'MyJavaProject'
Project directory structure:
MyJavaProject
-> main
-> java
-> myJavaPackage
-> runner
-> MainRunner
I'm using Gradle 11.1
Since the stack trace is huge I did not post the entire one.
Close to the bottom it shows:
Caused by: groovy.lang.MissingPropertyException: Could not find property 'myJavaPackage' on root project 'MyJavaProject'.
I searched for this type of error but the answers were mostly about upgrading Gradle from an old version to a newer one.
What did I do wrong?
Upvotes: 7
Views: 38188
Reputation: 123986
Correct is (notice the quotes):
mainClassName = "myJavaPackage.runner.MainRunner"
Upvotes: 9