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.
Contents
How to Fix ERROR: JAVA_HOME is set to an invalid directory Error?
- 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 withC:\Program Files\Java\jdk1.8.0_12
- 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 theJAVA_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
- UnhandledPromiseRejectionWarning: This error originated either by throwing inside of an async function without a catch block
- Error: PostCSS plugin tailwindcss requires PostCSS 8
- ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation
- java.lang.IllegalArgumentException: Malformed \uxxxx encoding
- Could not find a version that satisfies the requirement cv2 (from versions: ) No matching distribution found for cv2