title: "Could not find or load main class" Error while running java program using cmd prompt
body: <p>I am running a simple "HelloWorld" Program. I get this error in the command prompt:</p>
  
  <blockquote>
    <p>Could not find or load main class <code>HelloWorld</code>.</p>
  </blockquote>
  
  <p>I have set the <code>CLASSPATH</code> and <code>PATH</code> variable in the system. In the <code>cmd</code> prompt, I am running from the directory where I have saved <code>HelloWorld</code> program. I can see the class name and the file name are same and also <code>.class</code> file created in the same directory. What else could be the problem?</p>
  
  <p>My sample program looks like this:</p>
  
  <pre><code>package org.tij.exercises;
  public class HelloWorld {
    public static void main(String[] args) {
      // TODO Auto-generated method stub
      System.out.println("Hello World!!");
    }
  }
  </code></pre>