The PATH is the system variable that your operating system uses to locate needed executables from the command line or Terminal window. The PATH system variable can be set using System Utility in control panel on Windows, or in your shell’s startup file on Linux and Solaris.
If you get error as Shown on Figure 1, you must add java into path at Environment Variable. This is step to add java:
1. Open Computer Properties as shown on Figure 2 and click Change Setting.
2. On System Properties window click tab Advanced and click Environment Variables.
3. On Environment Variables window select Path in System Variables and then click edit as shown on Figure 3.
4.Modify Path by adding the location of the java JDK bin to the value for Path (use semicolon”;” to separate code) and then click OK as shown on Figure 4.
5. To check it is correct or not reopen your Command Prompt write java and enter if you see like Figure 5 your configure is correct.
6. Then try this code again to get SHA1.
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android