title: How to fix Error: Unnecessarily replacing a task that does not exist has been deprecated
body: <p>I am new to learning java, and believe I am missing a step somewhere. I am simply trying to output "Hello World" in android studio.</p>
  
  <p>I am taking an online class through udemy, and this has halted me completely. I even did a complete PC wipe to ensure none of my settings were screwing anything up.</p>
  
  <pre><code>package com.example.learnjava;
  
  public class HelloWorld {
      public static void main(String[] args) {
      System.out.println("Hello World");
      }
  }
  </code></pre>
  
  <p>Expecting the output "Hello World" in the console, instead get the following error:</p>
  
  <blockquote>
    <p>11:20:01 PM: Executing task 'HelloWorld.main()'...</p>
    
    <p>Executing tasks: [HelloWorld.main()] in project C:\Users\phuiz\AndroidStudioProjects\LearnJava</p>
    
    <p>Configure project :app
    Unnecessarily replacing a task that does not exist has been deprecated. This is scheduled to be removed in Gradle 6.0. Try using create() or register() directly instead. You attempted to replace a task named 'HelloWorld.main()', but no task exists with that name already.
        at HelloWorld_main___8g5slkzupty1xjavpsz1qxha8$_run_closure1$_closure2.doCall(C:\Users\phuiz\AppData\Local\Temp\HelloWorld_main__.gradle:18)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)</p>
    
    <p>FAILURE: Build failed with an exception.</p>
    
    <ul>
    <li><p>Where:
    Initialization script 'C:\Users\phuiz\AppData\Local\Temp\HelloWorld_main__.gradle' line: 20</p></li>
    <li><p>What went wrong:
    A problem occurred configuring project ':app'.
    Could not create task ':app:HelloWorld.main()'.
    SourceSet with name 'main' not found.</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>
    <li><p>Get more help at <a href="https://help.gradle.org" rel="noreferrer">https://help.gradle.org</a></p></li>
    </ul>
    
    <p>BUILD FAILED in 0s
    11:20:01 PM: Task execution finished 'HelloWorld.main()'.</p>
  </blockquote>