title: Problem encountered in react native run android
body: <p>I recently installed React Native on my Windows PC and I created a project but when i try with react-native run-android for android emulator it shows me:</p>
  
  <pre><code>C:\ReactNative\testproj&gt;react-native run-android
  info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
  Jetifier found 855 file(s) to forward-jetify. Using 4 workers...
  info JS server already running.
  info Installing the app...
  
  ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files (x86)\Java
  
  Please set the JAVA_HOME variable in your environment to match the
  location of your Java installation.
  
  error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
  Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
      at checkExecSyncError (child_process.js:629:11)
      at execFileSync (child_process.js:647:13)
      at runOnAllDevices (C:\ReactNative\testproj\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
      at buildAndRun (C:\ReactNative\testproj\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
      at then.result (C:\ReactNative\testproj\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12)
      at process._tickCallback (internal/process/next_tick.js:68:7)
  </code></pre>
  
  <p>Please help</p>