Setting the missing “JAVA_HOME” system environment variable worked for me.
- Press WIN+Pause on keyboard.
- Click advanced system settings.
- Click “Environment variables”.
- Click “New” under “System variables”.
- Type “JAVA_HOME” in the Variable name field.
- Type the path to the JDK in the Value field. For me the correct path
with short filename was “C:\PROGRA~1\Java\jdk1.8.0_66”. Your path will vary depending on the installed version. - Click OK, and OK in previous window too.
- Restart any command prompts or restart the computer.
react-native run-androidworked fine after that.