First reinstall the jdk again.
And save all your programs in other folder, not where jdk is installed.
You can use set path command , but u will need to type it each time u open the cmd prompt. Else u can set path in enviroment variable only once(No need set it again).
Command is :
set path = "X:\Folder_name\bin"
eg. set path = "C:\jdk1.6\bin"
where, X is drive where u hv installed jdk & folder_name is folder name in which jdk is installed.
U can verify whether path is set or not by using command , path.
For enviromental varible :
My computer -- RClick -- Properties -- Advanced --Environment variables -- System variables -- Path -- Edit -- In variable value field -- after the last word if there is a no semicolon type ; else not.
After the semicolon type the path.
eg. ;C:\jdk1.6\bin
Then press ok.
Reopen the cmd prompt and try javac , java command without any file name
it will show u all the options related with commands.
Now compile & run ur programs.
Happy Programming
