Hi Abhay,
The Java ..\bin directory has to be in your PATH environment variable on a WINDOWS machine. The fully qualified PATH to the ..\bin directory is dependent on where in your harddrive directory hierarchy you installed Java.
Using the code exactly as listed in this thread, I was able to invoke the following commands:
C:\TEMP> javac StringTest.java
This command compiles the code.
C:\TEMP> java StringTest
This command invokes the compiled bytecode.
This example will not work if your PATH environment variable in WINDOWS is not configured correctly. REMEMBER: you have to reboot your computer after you configure the PATH environment variable. The new PATH doesn't become effective until your computer has been rebooted.
The CLASSPATH variable has to be defined in your environment variables. CLASSPATH should be equal to
.; this is a dot followed by a semicolon.
reboot your computer after creating the CLASSPATH and modifying the PATH.
Regards, Harry