title: Java and Gradle - Build failed with an exception
body: <p>I want to simply debug hello Java, but some gradual error is causing failure while debugging my code.</p>
  
  <pre><code>package learning.javalearning;   
      public class demo {
          public static void main(String[] args) {
              System.out.println("Hello J");
      }
  }
  </code></pre>
  
  <p>FAILURE: Build failed with an exception.</p>
  
  <ul>
  <li><p>Where:
  Initialization script <code>'C:\Users\JERRI._PC\AppData\Local\Temp\demo_main__.gradle' line: 20</code></p></li>
  <li><p>What went wrong:
  A problem occurred configuring project <code>':app'</code>.
  <code>Could not create task ':app:demo.main()'. SourceSet with name 'main' not found.</code></p></li>
  <li><p>Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.</p></li>
  </ul>