title: Gradle error: "Could not find property '...' on root project '...'
body: <p>I try do build my Java project with <code>Gradle</code> and I'm getting the following:</p>
  
  <pre><code>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'.
  &gt; Could not find property 'myJavaPackage' on root project 'MyJavaProject'.
  </code></pre>
  
  <p>Line <strong>25</strong> of <code>build.gradle</code>: <code>mainClassName = myJavaPackage.runner.MainRunner</code></p>
  
  <p>In <code>settings.gradle</code> I have: <code>rootProject.name = 'MyJavaProject'</code></p>
  
  <p><em>Project directory structure</em>: </p>
  
  <p><code>MyJavaProject</code>-> <code>main</code> -> <code>java</code> -> <code>myJavaPackage</code> -> <code>runner</code> -> <code>MainRunner</code></p>
  
  <p>I'm using <strong>Gradle 11.1</strong></p>
  
  <p>Since the stack trace is huge I did not post the entire one.</p>
  
  <p>Close to the bottom it shows: </p>
  
  <blockquote>
    <p>Caused by: groovy.lang.MissingPropertyException: Could not find
    property 'myJavaPackage' on root project 'MyJavaProject'.</p>
  </blockquote>
  
  <p>I searched for this type of error but the answers were mostly about upgrading Gradle from an old version to a newer one.</p>
  
  <p>What did I do wrong? </p>