Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unable to install Open JDK with Unity Hub

Discussion in 'Editor & General Support' started by Jenifer_Jane, May 2, 2020.

  1. Jenifer_Jane

    Jenifer_Jane

    Joined:
    Jan 24, 2017
    Posts:
    69
    i tried installing Open JDK with unity Hub several times in Unity 2019.3.10f1 but its always available to download even after download and Installing its not getting marked as "Installed" and whenever i try to build my game i am getting this error : -
    UnityException: JDK not found
    Java Development Kit (JDK) directory is not set or invalid. Please, fix it in Preferences -> External Tools
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    Build completed with a result of 'Failed' in 3 seconds (3193 ms)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002bb] in <17b72532ee2c4da1b6f632d3f1705fe0>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <17b72532ee2c4da1b6f632d3f1705fe0>:0
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
    also Unity Default installation folder C:\Program Files\Unity\Hub\Editor\2019.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
    is also Empty
     
  2. Jenifer_Jane

    Jenifer_Jane

    Joined:
    Jan 24, 2017
    Posts:
    69
    Nevermind fixed it with manual install.
     
  3. Hiddenworlds225

    Hiddenworlds225

    Joined:
    Apr 18, 2017
    Posts:
    32
    Having this problem. How do I manual install?
     
  4. Jenifer_Jane

    Jenifer_Jane

    Joined:
    Jan 24, 2017
    Posts:
    69
    Download Java JDK from https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html#license-lightbox
    theirs a most recent version also available but i downloaded older version since i used that before with unity you can download whichever version u like
    change your install directory to C:\Program Files\Unity\Hub\Editor\2019.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer

    or where ever your unity editor install directory complete install. Restart Unity and its done
     
    Last edited: May 3, 2020
  5. thszabi

    thszabi

    Joined:
    May 3, 2020
    Posts:
    1
    Thank you Jenifer_Jane, your solution worked for me as well! I'm using Unity 2019.3.12f1
     
    Jenifer_Jane likes this.
  6. Hiddenworlds225

    Hiddenworlds225

    Joined:
    Apr 18, 2017
    Posts:
    32
    Jenifer_Jane likes this.
  7. rsodre

    rsodre

    Joined:
    May 9, 2012
    Posts:
    229
    I started installing all the Android tools from Unity Hub, hoping it would save me the trouble of managing it...
    Unity should build it's envirounment around the JDK installed with Unity!
    Looks like it is not!
    Even if I add the proper JAVA_HOME and set the PATH to the Unity JDK, it does not work. I can run java from the terminal (i'm on mac here).

    Makes no sense install JDK if Unity already has its own.
    Won't be too long before it starts complaining my installed JDK is outdated instead of using its own.
     
    Nerzhul2000 and Rippp3r like this.
  8. Jenifer_Jane

    Jenifer_Jane

    Joined:
    Jan 24, 2017
    Posts:
    69
    Well my JDK directory in Unity was Empty in your case its different it seems and havn't tested on Mac so no idea whats wrong.
     
    Stonegolemstudio likes this.
  9. rsodre

    rsodre

    Joined:
    May 9, 2012
    Posts:
    229
    I confess I did something different here. Since my internet is terrible, it takes hours to download a Unity install, and any hiccup on the network breaks the download, that must be started all over again... I download Editors on one mac and copy the full Editor folder to my other macs. Unity Hub always accepted that, just restart and it will recognize the cloned install, but seems that while installing Android tools it does something more than save files. Re-installed the full Editor, Android platform and tools and it works now.

    As suggestions for inproving Hub...

    - If the network goes down during download, please retry a few times. If still down, do not delete everything and force us to start the dowload from scratch, show us a Retry/Continue dialog, and delete downloaded content only if we ask to Cancel.

    - Check and correct Android tools installation before starting up an Editor, so we can still copy Editors to other machines.
     
  10. gomezmarco195

    gomezmarco195

    Joined:
    Jun 4, 2020
    Posts:
    2
    [QUOTE = "Jenifer_Jane, publicación: 5797078, miembro: 1273714"] Descargue Java JDK desde https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html#license-lightbox
    la versión más reciente también está disponible, pero descargué una versión anterior, ya que la usé antes con Unity, puedes descargar la versión que quieras
    cambie su directorio de instalación a C: \ Archivos de programa \ Unity \ Hub \ Editor \ 2019.3.10f1 \ Editor \ Data \ PlaybackEngines \ AndroidPlayer

    o donde su directorio de instalación de Unity Unit complete la instalación. Reiniciar Unity y listo [/ QUOTE]



    También tengo el mismo problema, exactamente que versión del JDK descargaste? la version 13? 14?
     
  11. gomezmarco195

    gomezmarco195

    Joined:
    Jun 4, 2020
    Posts:
    2
    Lo arreglé!!! solo deben de desactivar su antivirus antes dedescargar ek openJDK del Unity Hub y listo!! Parece que el antivirus es que bloquea la descarga por eso que no se llega a instalar, jagan lo que les digo y asunto arreglado!
     
  12. mariogonzalezuntcllb

    mariogonzalezuntcllb

    Joined:
    May 11, 2020
    Posts:
    1
    Yep, funciona, puto avast xD.

    Deactivate avast/windows defender etc, and it should work guys.
     
  13. alexbosh_unity

    alexbosh_unity

    Joined:
    Jun 4, 2020
    Posts:
    1
    Thanks.
     
  14. Juandapp

    Juandapp

    Joined:
    May 11, 2016
    Posts:
    53
    Muchas gracias amigo, funcionó!!!!! :):):):):):):):):):):p:p:p:p:p:p:p:p:p:p

    The problem is AVAST or your antivirus. Desactive and working!!
     
    LeandroExHuMeD and ALIENPANDA like this.
  15. RafaRamirez

    RafaRamirez

    Joined:
    Nov 6, 2019
    Posts:
    2
    Exacto ... pinche avast .. ya había intentado muchas veces y nada !!!
    Gracias !!!
     
    LeandroExHuMeD likes this.
  16. ion_unity

    ion_unity

    Joined:
    Jul 23, 2020
    Posts:
    6
    Same issue here, solved disabling AVAST! Thanks :)
     
  17. mobiwalkers

    mobiwalkers

    Joined:
    Sep 29, 2015
    Posts:
    1
    awesome working, thanks save my time
     
    LeandroExHuMeD and TextusGames like this.
  18. gabrielesimula

    gabrielesimula

    Joined:
    May 21, 2020
    Posts:
    12
    Disabling avast worked for me as well, thanks!
    P.s. it worked with 2020.1.0f1 but not with 2019.4.5f1
     
    Last edited: Jul 26, 2020
    LeandroExHuMeD and TextusGames like this.
  19. rmmarks

    rmmarks

    Joined:
    Jul 17, 2017
    Posts:
    1
    Disabled Avast and it worked! (so obvious :rolleyes: ) Thanks guys!
    I am using 2019.4.5f1 and it worked ok... so far.
     
    LeandroExHuMeD likes this.
  20. sinjimonkey

    sinjimonkey

    Joined:
    Jul 31, 2013
    Posts:
    72
    I used Jenifer_Jane's method to get rid of the error, though Unity Remote still doesn't play through my Android device. But the error I was getting before when I tried isn't there.
     
  21. lukaszkowalski2013_unity

    lukaszkowalski2013_unity

    Joined:
    Feb 25, 2020
    Posts:
    4
    thanks for the tip with Avast! worked for 2020.1 as well
     
    LeandroExHuMeD and TextusGames like this.
  22. SubicaBubica

    SubicaBubica

    Joined:
    Aug 9, 2020
    Posts:
    4
    You can just turn off avast protection for 10 minutes, then reinstall openJdk. It worked for me.
     
    zizozied2014 and LeandroExHuMeD like this.
  23. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    AVAST was causing the problem!
     
    zizozied2014 and LeandroExHuMeD like this.
  24. LeandroExHuMeD

    LeandroExHuMeD

    Joined:
    Apr 6, 2016
    Posts:
    5
    AVG was causing the problem, disabling it worked for me as well, thank you guys!

    p.s: My version of Unity is 2020.1.3f1
     
    zizozied2014 and TextusGames like this.
  25. asarz23

    asarz23

    Joined:
    May 19, 2020
    Posts:
    1
    AVAST was causing the problem!
     
    zizozied2014 likes this.
  26. Zydawn

    Zydawn

    Joined:
    Sep 3, 2020
    Posts:
    1
    YEP, been trying for weeks.
    thanks
     
  27. lachean

    lachean

    Joined:
    Feb 20, 2017
    Posts:
    4
    Its works, AVAST off. Thanks!
     
    zizozied2014 likes this.
  28. ahmedaniss

    ahmedaniss

    Joined:
    Sep 18, 2019
    Posts:
    98
    problem fixed here :
     
    Orimay likes this.
  29. AnuragCsharp

    AnuragCsharp

    Joined:
    Sep 26, 2019
    Posts:
    1
    The Potential Fix for this issue would be:

    I have two version of Unity Installed, one is 2019.3 and other is 2019.4..

    everything working fine on 19.3 but sucks at 2019.4... so I've copied the path from 19.3 and set-up the same onto 19.4 and wola.. things are fixed now. its working :p
     
  30. IqraImtiaz

    IqraImtiaz

    Joined:
    Feb 3, 2021
    Posts:
    16
    I installed unity version 2019.3.7 ....while installation I also install modules of Android Built Support with all of its sub-components(SDK, NDK, and Open JDK). But no folder is made of OpenJDK in AndroidPlayer.
    I manually install JDK 1.8 and add the variable path and JAVA_HOME path. But when I use unity Remote it shows the error of JDK not set or invalid. What should I do? How it could be fixed? I have no avast that I need to disable.
     
  31. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    Same issue there.
    It's says it's already installed but either SDK, NDK or JDK directories are available.
    - Hub 2.3.2
    - Unity 2021.1.6f1
    upload_2021-5-14_14-13-52.png upload_2021-5-14_14-14-22.png upload_2021-5-14_14-15-9.png
     
  32. Juandapp

    Juandapp

    Joined:
    May 11, 2016
    Posts:
    53
    [QUOTE = "sama-van, post: 7139510, member: 7725"] El mismo problema.
    Dice que ya está instalado, pero los directorios SDK, NDK o JDK están disponibles.
    - Eje 2.3.2
    - Unidad 2021.1.6f1
    [ADJUNTE] 853811 [/ ADJUNTE] [ADJUNTE] 853814 [/ ADJUNTE] [ADJUNTE] 853817 [/ ADJUNTE] [/ QUOTE]
    Disable the antivirus and reinstall the version with the antivirus disabled. Greetings @sama-van
     
  33. Hiddenworlds225

    Hiddenworlds225

    Joined:
    Apr 18, 2017
    Posts:
    32
    Switched to BitDefender from Avast a few months back. Never had issues like this again. It's defo your antivirus if you have any issues, not Unity.
     
  34. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    322
  35. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    I may have uninstalled the whole, restarted machine and reinstalled again from scratch...
     
    wagenheimer likes this.
  36. Hiddenworlds225

    Hiddenworlds225

    Joined:
    Apr 18, 2017
    Posts:
    32

    best chance it was caused by your antivirus, as it seems to block most of the requests needed to get the sdks. Shut off your antivirus and try again.
     
  37. StevenTillson02

    StevenTillson02

    Joined:
    Jun 30, 2021
    Posts:
    11
    I began installing all of the Android utilities from Unity Hub in the hopes of avoiding the hassle of managing everything...
    Unity's environment should be built around the JDK that comes with the game!
    It doesn't appear to be the case!
    It does not function even if I add the correct JAVA HOME and set the PATH to the Unity JDK. I can use the terminal to execute java (I'm on a Mac).
     
  38. DaveLHOz

    DaveLHOz

    Joined:
    Mar 11, 2015
    Posts:
    8
    I can confirm that this works... I have Acronis TrueImage for backups, and since they started bundling it with its own anti-virus/malware (whether you want it or not) I haven't been able to install ANY version of Unity through the Hub. I temporarily disabled the Acronis antivirus protection, and then a Unity install through the Hub worked.
     
  39. Hiddenworlds225

    Hiddenworlds225

    Joined:
    Apr 18, 2017
    Posts:
    32
    BitDefender doesn't have that issue right now, try using that if you want.
     
  40. Oblica

    Oblica

    Joined:
    Feb 20, 2021
    Posts:
    30
    I believe many people might be facing this issue. After running pillar to post and reading hundreds of posts on many forums, I was able to resolve the issue.
    1. Disable any anti virus before installing Unity Hub or Unity Editor. I have Norton so disabled it first.
    2. DO NOT download Unity Hub Beta. I have installed it first and problem has started from there. Install Unity Hub - 2.4.5. This is the version which solved my issue.
    3. Start Unity Hub - 2.4.5 as "Run as Administrator".
    4. Add Unity Editor - 2020.3.20f1 release but DO NOT select Android module. This will be installed later.
    5. Let Unity Editor installs properly.
    6. Then select this installation in the Hub and select Add Module. Here select Android Build Support. Expand it and select both sub-options SDK, NDK and OpenJDK.
    7. Let Android module installs properly
    8. Locate your project in Unity Hub and click to load it in Unity Editor.
    9. Copy the OpenJDK path from Preferences >> External Tools.
    10 Go to Windows Environment Variables. Add JAVA_HOME variables in both Users and System variables section. Paste the OpenJDK path there. You may need to restart the PC to take these variables into effect. But I am not sure. Do so if you see a warning about it in Unity Editor
    11. Come back to Unity Editor and try to build the project.
    12. If you get a warning about obsolete Android SDK, click on Update SDK button.
    13. You Android build should be done after that (apk or aab). At least it built in my case.:)
     
    Vansoul likes this.
  41. radenadam

    radenadam

    Joined:
    Nov 21, 2021
    Posts:
    1
    This is really frustrating problem, after experiencing this same issue, I've done some research on how to fix this problem, others said that you need to disable Avast, but I don't have Avast or whatever antiviruses, I've done opening it as a system administrator, I've disabled my firewall, and also disabled the real-time protection on windows defender, I've done all of that but still no answer for me.

    Until, I've been curious about if this problem is actually going on the network side(because when I actually want to download it manually from the link in the module.json, it just said that the site can't be reached), so I've done a solution that I've seen no one mentioned before in the forum. I think this problem has a correlation with the proxy server or whatever(correct me if I'm wrong), but using VPN(in my case, I used cloudfare WARP) would fix the problem. So, good luck and stay strong guys.
     
  42. bleater

    bleater

    Joined:
    Apr 19, 2012
    Posts:
    26
    Last edited: May 25, 2022
  43. Stonegolemstudio

    Stonegolemstudio

    Joined:
    Feb 26, 2022
    Posts:
    13
    Mine was empty too after installing. WTH?