Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

JAVA_HOME is set to an invalid directory react-native

i have installed the openjdk11 with Chocolatey and set JAVA_HOME TO C:\Program Files\Eclipse Adoptium\jdk-11.0.16.101-hotspot\bin but when i try to run the command npx react-native run-android it give and error

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Eclipse Adoptium\jdk-11.0.16.101-hotspot\bin

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

it was working fine 2 weeks ago but now its not working .

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

There should be no ‘\bin’ in JAVA_HOME. It’s the installation directory. OTOH, it can be in PATH, by prepending %JAVA_HOME%\bin; That will mean that your new installation (defined by JAVA_HOME) will take precedence for execution.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading