The possible issue could be related to the JAVA_HOME environment variable value. If the value is referring to a path like below you will most likely get this kind of error.
Ex:
C:\Program Files\Java\jdk1.8.0_131
Solution (that worked for me):
1. Change the JDK path as provided below:
C:\Program~1\Java\jdk1.8.0_131
Please refer the below link knowing more about setting the JAVA_HOME.
Site Link: Set JAVA_HOME
Ex:
C:\Program Files\Java\jdk1.8.0_131
Solution (that worked for me):
1. Change the JDK path as provided below:
C:\Program~1\Java\jdk1.8.0_131
Note for Windows users on 64-bit systems
Progra~1 = 'Program Files'Progra~2 = 'Program Files(x86)'
Please refer the below link knowing more about setting the JAVA_HOME.
Site Link: Set JAVA_HOME