I have set JAVA_HOME in my system C:\\Program Files\\Java\\jdk1.8.0_
131\\bin; and I am trying to run cordova command( cordova build ) on command p
On Window 10, the problem was with the semicolon ;.
Go to edit the system environment variables and delete the semicolon at the end of JAVA_HOME value C:\Program Files\Java\jdk1.8.0_144
In other words, convert this C:\Program Files\Java\jdk1.8.0_12; to C:\Program Files\Java\jdk1.8.0_12
You might have to delete your entry in the Windows Dialog and create a new one. If you ever had multiple entries and get the bigger Form view, Windows automatically inserts a ; at the end of each entry, even if you only have one entry left.