Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug JAVA_HOME is not set and no 'java' command could be found in your PATH

Discussion in 'Android' started by Stranger-Games, Sep 5, 2019.

  1. madhur_novotrax

    madhur_novotrax

    Joined:
    Mar 28, 2023
    Posts:
    3
    This error appears when you have any google sdk present in your project.
    Fix:
    1. In your unity Preferences (Edit -> Preferences) there is a JDK path, copy it.
    2. Open Environment variables in windows. Look under "System variables" for a variable name "JAVA_HOME" then Click Edit. (If not present Click Create).
    3. write variable name as "JAVA_HOME" and in variable value paste the JDK path you copied. and press OK.
    4. Restart unity.
    And it should work Fine!
     
  2. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    Hah, the issue still exists in Unity 2021, and the "fix" works.
     
  3. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    This hacky stuff is so frustrating, but it works, thank you! Unity 2020.3.42f1 LTS
     
  4. darkmattergamedev

    darkmattergamedev

    Joined:
    Apr 1, 2021
    Posts:
    1
    Thanks