JAVA_HOME is set to an invalid directory:
Asked 07 September, 2021
Viewed 344 times
  • 55
Votes

I have set JAVA_HOME in my system C:Program FilesJavajdk1.8.0_ 131in; and I am trying to run cordova command( cordova build ) on command prompt, but I'm getting the error bellow. I have tried all the ways, but not able to resolve this issue:


  

ERROR: JAVA_HOME is set to an invalid directory: C:Program FilesJavajdk1.8.0_ 131in;

Please, set the JAVA_HOME variable in your environment to match the location of your Java installation.

16 Answer