title: How do I define main(String[] args) in Java without getting warnings and errors?
body: <p>When I create a new main.java file in the default package in my Eclipse project, it generates a <code>main</code> method that looks like:</p>
  
  <pre><code>public static void main(String[] args)
  {
  }
  </code></pre>
  
  <p>This immediately raises a warning that says <code>This method has a constructor name</code>.  The suggested fix is to remove the <code>void</code>:</p>
  
  <pre><code>public static main(String[] args)
  {
  }
  </code></pre>
  
  <p>Now rather than a warning, I get an error: <code>Illegal modifier for the constructor in type main; only public, protected &amp; private are permitted</code>.  If I remove the <code>static</code>, my code now looks like:</p>
  
  <pre><code>public main(String[] args)
  {
  }
  </code></pre>
  
  <p>This time, I still get an error, but a different one that says:</p>
  
  <pre><code>Error: Main method not found in class main, please define the main method as:
      public static void main(String[] args)
  </code></pre>
  
  <p>Argggh!  But that takes me right back to where I started.  How do I define the main method so that I don't get any errors or warnings?</p>
  
  <p>I'm using <em>Eclipse Juno Service Release 2</em> and <em>JavaSE-1.7</em>.  Please note, I'm very new to Java; I come from a C# background.  Also, this is probably a duplicate question, but I can't find it.</p>