i am a new java student i am running a hello world program in command prompt but i am getting a error
class hello{
public static void main(String agrs[]){
system.out.println("Hello world");
}
}
this is my hello world program
G:\java>javac hello.java
G:\java>dir
Volume in drive G has no label.
Volume Serial Number is 32DF-BA6B
Directory of G:\java
14-Sep-13 04:36 PM <DIR> .
14-Sep-13 04:36 PM <DIR> ..
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>java hello
Error: Could not find or load main class hello
my java path is right
G:\java>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
but when is use this command then program run .
G:\java>java -classpath . hello
Hello world
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
G:\java>java hello