
i have installed java in pc but when i run and compile any program the massage is display that 'javac' is not recognized as an internal or external command

You should set Environment variable for compiling or running java.
If you are using windows 7, try these steps.
Go to My Computer -> System properties -> Advanced system settings -> Environment variables -> press "New".
Variable name: PATH Variable value: C:\Program Files\Java\jdk1.6.0_32\bin;%PATH%
Save it. and again press "New".
Variable name: CLASSPATH Variable value: C:\Program Files\Java\jdk1.6.0_32\lib\tools.jar;.
Save it. It should work properly now.
If you are using a different OS, let me know what it is and i will tell you how to set these for it.