Answer:
For Windows and Dos
Frist Install Java Development Kit JDK in C:\ drive
Second Set path by giving folloing command path = %path%;c:\jdk1.3\bin;c:\jdk1.3\lib with your proper version of JDK(i.e. jdk1.2.2 or jdk1.2 etc).
Third Write simple program in Edit of Ms Dos or Notpad with "class_name.java". Here class_name is the name of file you used in your program with the keyword class. Remamber Java is case sensitive.
Fourth run this command javac class_name.java and remove the program error if any this command will compile your java program
Fifth run this command java class_name