- Home /
How to set JAVA_HOME using OpenJDK?
I installed Unity 2019.1.5f1 , and I am using Firebase. When I used Android Resolver there is this problem that says I need to set JAVA_HOME:
Gradle failed to fetch dependencies. ... ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
As far as I know Unity is using OpenJDK which is fine by me, but how to I set the JAVA_HOME using the OpenJDK? I don't even know where it is located. How do I set the JAVA_HOME variable using OpenJDK?
Answer by jsdupuis · Jun 23, 2019 at 06:59 AM
Link should look like this (I'm using Windows):
C:\Program Files\2019.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\OpenJDK\Windows\
To edit JAVA_HOME:
right click on My Computer and select Properties
go to Advanced Computer Settings
click on Environment Variables
Edit JAVA_HOME with the path or add new variables if not listed
reboot computer
Thanks for your answer. Just a little correction. In most cases the path will be looking more like this:
C:\Program Files\Unity\Editor\2019.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJD$$anonymous$$
in my case, [OpenJD$$anonymous$$] is under [Tools] folder
so the full path will be
C:\Program Files\Unity\Editor\2019.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\OpenJD$$anonymous$$
Answer by Yerbol05 · May 19, 2020 at 09:23 PM
I set the variable as in the next link. Worked for me. https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html
Answer by sboger · Jul 21, 2020 at 12:54 PM
Thanks for this work around I read your comments and applied and all is working good can't believe the software is so unstable
Answer by Lexxxis · Mar 22, 2021 at 07:20 PM
Thank you for your ideas. They are really helpful. I couldn't imagine that such troubles might occur with the software.
Your answer
Follow this Question
Related Questions
Strange android error - adb.exe - unity 4.6.1 2 Answers
Always ask to updating android SDK 4 Answers
I can't use TTS on Android 11 1 Answer
One Signal dependecies issue 0 Answers
Are there tutorials on how to get my project into android studio? 0 Answers