In windows, go to Control Panel, then select System. then select Advanced tab.
At the button of this tab, click Environment Variables and then at System variables
add a new variable named JAVA_HOME and set it's value to your installation path of Java.
(like C:\java ). After submitting this form, select PATH from list and click Edit. at the end
of the list of paths add exactly ;%JAVA_HOME%\bin and then click Ok. To see if everything
works well, open new command prompt window and type: javac -version if no error happened,
you are at the right place to start other commands like keytool.