You need Java in your bin path - or put in the full pathname.
The easiest way to make sure you have the path correct is to navigate to the folder containing the java exe (i.e. use the cd command in the cmd window, use dir to confirm you are in the correct folder) and then type java -version and java.exe -version there.
By navigating to the folder you have confirmed that you are going to the right location.