Home > Enterprise >  ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_102
ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_102

Time:04-20

I'm trying to run react native cli and I'm coming across the error below:

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_102

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

I was getting different build errors yesterday and when trying to debug I set the JAVA_HOME to their answer on SO. Since, I have been getting the error above and found no solution. Most of the answers consist of removing \bin but as you can see that is not set in the current directory.

I have tried reinstalling Java and setting it to the known path but the error did not change.

Is it strange that I had no Java file prior to manual installation this morning and the cli was running?

Grateful for any advice and help.

CodePudding user response:

Obviously, you are misconfigured. it's my pc JAVA_HOME. enter image description here

enter image description here

  • Related