title: How can I run thread from Main method in Java application?
body: <p>I believe variables used in <code>static main</code> method should be also <code>static</code> as well.
  The problem is that I cannot use <code>this</code> in this method at all. If I remember correctly, I have to initiate thread with commnad <code>myThread = new ThreaD(this)</code>.</p>
  
  <p>The below codes produces an error because I used <code>this</code> in thread initiation.
  What have I done wrong here?</p>
  
  <pre><code>package app;
  
  public class Server implements Runnable{
  
      static Thread myThread;
  
  
      public void run() {
          // TODO Auto-generated method stub  
      }
  
      public static void main(String[] args) {
          System.out.println("Good morning");
  
          myThread = new Thread(this);
  
  
  
      }
  
  
  }
  </code></pre>