In your Control Panel go to System > Advanced system settings > Environment variables.
If you have not already got a JAVA_HOME variable you will need to add one. If you JDK is installed to "C:\Program Files\Java\jdk1.6.0_21" then that will be the value for JAVA_HOME. In your existing PATH variable you will need to make sure that the path to the JDK bin folder is there "C:\Program Files\Java\jdk1.6.0_21\bin". As the java home variable has been set you can use %JAVA_HOME%\bin, or "C:\Program Files\Java\jdk1.6.0_21\bin". It's up to you. (remember a semicolon is needed between entries to your PATH variable).
Once this is done test it on command line:
echo %JAVA_HOME% - should display path to your JDK
echo %PATH% - will show all you paths, so make sure path to JDK bin folder is there.
java -version - should now be able to be done from any directory and give correct version for your JDK.