close

[Solved] ERROR: JAVA_HOME is set to an invalid directory

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to run my cordova command But I am facing following error ERROR: JAVA_HOME is set to an invalid directory in Java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How This Error Occurs ?

I am trying to run my cordova command But I am facing following error.

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_ 131\bin;

How To Solve ERROR: JAVA_HOME is set to an invalid directory Error ?

  1. How To Solve ERROR: JAVA_HOME is set to an invalid directory Error ?

    To Solve ERROR: JAVA_HOME is set to an invalid directory Error Error Is saying that There is just no need to add bin into PATH variable. You need to set the JAVA_HOME like this. JAVA_HOME=”C:\Program Files\Java\jdk1.8.0_131″ Just set JAVA_HOME like this and your error will be solved.

  2. ERROR: JAVA_HOME is set to an invalid directory

    To Solve ERROR: JAVA_HOME is set to an invalid directory Error Error Is saying that There is just no need to add bin into PATH variable. You need to set the JAVA_HOME like this. JAVA_HOME=”C:\Program Files\Java\jdk1.8.0_131″ Just set JAVA_HOME like this and your error will be solved.

Solution 1: set the JAVA_HOME like this

Error Is saying that There is just no need to add bin into PATH variable. You need to set the JAVA_HOME like this.

JAVA_HOME="C:\Program Files\Java\jdk1.8.0_131"

Just set JAVA_HOME like this and your error will be solved.

Solution 2: Remove the \bin

  1. Remove the \bin from PATH variable.
  2. also remove the ; at the end
  3. After restart the cmd and run again.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

2 thoughts on “[Solved] ERROR: JAVA_HOME is set to an invalid directory”

Leave a Comment