close

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

Today We are Going To Solve ERROR: JAVA_HOME is set to an invalid directory in Java. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

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

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

    To Fix ERROR: JAVA_HOME is set to an invalid directory Error just set it with C:\Program Files\Java\jdk1.8.0_12. To solve this error just set it with C:\Program Files\Java\jdk1.8.0_12

  2. ERROR: JAVA_HOME is set to an invalid directory

    To Fix ERROR: JAVA_HOME is set to an invalid directory Error just Set the JAVA_HOME. You have to set the JAVA_HOME just like belowJAVA_HOME="C:\Program Files\Java\jdk1.8.0_131"

Solution 1 : set it with C:\Program Files\Java\jdk1.8.0_12

To solve this error just set it with C:\Program Files\Java\jdk1.8.0_12

Solution 2 : Set the JAVA_HOME

You have to set the JAVA_HOME just like below

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

Solution 2 : Remove the \bin

Remove the \bin from your path variable and then remove the ; at the end.

Then restart cmd and run it.

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read These Solutions

Leave a Comment