title: Hi guys I keep getting the error ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH
body: <p>I keep getting</p>
  
  <blockquote>
    <p>ERROR: JAVA_HOME is not set and no 'java' command could be found in
    your PATH</p>
  </blockquote>
  
  <p>Whenever I try to run react-native code from my terminal to use an android emulator.</p>
  
  <p>I've recently been trying to set up react-native on my laptop through wsl because the virtual box has been giving me trouble using it.</p>
  
  <p>I've set my <code>ANDROID_PATH</code> to <code>C:\Users\username\AppData\Local\Android\Sdk</code> and <code>my JAVA_PATH to D:\Program Files\Java\jdk-13.0.1.</code> But I keep getting the error.</p>
  
  <blockquote>
    <p>info Running jetifier to migrate libraries to AndroidX. You can
    disable it using "--no-jetifier" flag. Jetifier found 863 file(s) to
    forward-jetify. Using 8 workers... info Starting JS server... /bin/sh:
    1: adb: not found info Launching emulator... error Failed to launch
    emulator. Reason: No emulators found as an output of <code>emulator
    -list-avds</code>. warn Please launch an emulator manually or connect a device. Otherwise, app may fail to launch. info Installing the app...
    ERROR: JAVA_HOME is not set and no 'java' command could be found in
    your PATH. 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:
    <a href="https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment" rel="nofollow noreferrer">https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment</a>.
    Run CLI with --verbose flag for more details. Error: Command failed:
    ./gradlew app:installDebug -PreactNativeDevServerPort=8081
        at checkExecSyncError (child_process.js:621:11)
        at execFileSync (child_process.js:639:15)
        at runOnAllDevices (/mnt/c/users/meron/Projects/react/New_project_7/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
        at processTicksAndRejections (internal/process/task_queues.js:93:5)</p>
  </blockquote>
  
  <p>I've tried everything but still no luck</p>