Thanks Michael. I need one more help. I am getting the following error when run the program.
I have set the classpath and path in the environmental variables as. CLASSPATH .;C:\j2sdk1.4.2_08
Since i was getting this error is thought my sdk has some problem so i uninstalled and reinstalled it once again.But that didnt solve my problem. Please let me know whether my classpath and path setting is correct.
I am also able to see a folder called JAVA under c:\ProgramFile which has one more j2sdk1.4.2_08.I dont know when this got installed.Do i need to uninstall this.
Leave the CLASSPATH empty (i.e. do not set it at all). It's not necessary to include C:\j2sdk1.4.2_08 in the CLASSPATH.
If it says it can't find java.lang.Object, the SDK is installed wrong or you maybe have another version of the Java Runtime Environment installed somewhere. Check that out and uninstall the other version.
As Jasper said, you do not need to set the CLASSPATH variable at this point. I strongly suggest that you remove it as it may cause some problems in the future if it isn't set correctly. Everything should work just fine without the CLASSPATH variable.