title: Error: Could not find or load main class hello in Windows 7
body: <p>i am a new java student 
  i am running a hello world program in command prompt but i am getting a error </p>
  
  <pre><code>  class hello{
  
  public static void main(String agrs[]){
   system.out.println("Hello world");
  }
  
  }
  </code></pre>
  
  <p>this is my hello world program</p>
  
  <pre><code>G:\java&gt;javac hello.java
  
  
  
   G:\java&gt;dir
   Volume in drive G has no label.
   Volume Serial Number is 32DF-BA6B
  
   Directory of G:\java
  
  14-Sep-13  04:36 PM    &lt;DIR&gt;          .
  14-Sep-13  04:36 PM    &lt;DIR&gt;          ..
  14-Sep-13  04:36 PM               415 hello.class
  14-Sep-13  04:35 PM               100 hello.java
                 2 File(s)            515 bytes
                 2 Dir(s)  55,645,966,336 bytes free
  G:\java&gt;java hello
  Error: Could not find or load main class hello
  </code></pre>
  
  <p>my java path is right </p>
  
  <pre><code>G:\java&gt;path
  PATH=G:\Windows\system32;G:\Windows;G:\Windows\System32\Wbem;G:\Windows\System32
  \WindowsPowerShell\v1.0\;G:\Program Files\Java\jdk1.7.0_25\bin
  </code></pre>
  
  <p>but when is use this command then program run .</p>
  
  <pre><code>G:\java&gt;java -classpath . hello
  Hello world
  </code></pre>
  
  <p>i want to ask that why is my program not run normally is any problem in my path setting variable ? i want to run my program normally as </p>
  
  <pre><code>G:\java&gt;java hello
  </code></pre>