Can't install JDK with unity hub

Hello, i got a problem with unity hub. I’m try to build my project into apk file with unity 2019.3.10f1, installed with unity hub. I have install the Android build Support (both ANdroid SDK & NDK tools and openJDK) or i touhght i did. I got an error while building: the openJDK isn’t found. I go back to unity hub and check: OpenJDK isn’t installed. I re-installed it (I maybe try like 10-20 times, unistall, re-install the unity hub nothing… On another version still nothing…) I’m losing faith any help?

I found a solution, works for me

set Avast to disable for 10 minutes or more, and the install using Unity Hub worked. I suspect it is the virus checker silently denying the connection driven by Unity Hub to get the OpenJDK.

I have the same problem. I even tried multiple versions (2019.3.11f1, 2020.1.0b6, 2020.2.0a8) and neither of these gets OpenJDK installed. I guess we have to take the old way and install JDK manually, then set the path in editor Preferences.

For those who still can’t get it working:

Download this file: http://download.unity3d.com/download_unity/open-jdk/open-jdk-win-x64/jdk8u172-b11_4be8440cc514099cfe1b50cbc74128f6955cd90fd5afe15ea7be60f832de67b4.zip

Extract it and go to your JDK folder. Delete all the contents and paste in the contents of the zip.

Now hit build and play :slight_smile:

Even now at 2019.3.15f1 OpenJDK still won’t install. I’ve tried uninstalling, rebooting and reinstalling but the directory is empty and going in to Add Modules still shows it checked but not installed.

EDIT: I thought maybe it was a permissions issue in my Unity folder because during a build I got a lot of errors on Unity not able to edit a bunch of XML files, so I added Authenticated Users with full permissions to the top of my Unity folder. Got rid of all the other errors but still didn’t help the JDK install.

I ended up getting the latest Oracle 8 SDK and so far it seems to be working (doing an AR Udemy course) though of course in the Preferences Unity is complaining I’m not using the official 1.8.0 JDK!

I had the same issue and the only way I could get it to work were by installing Unity3d on another computer and then manually copy the OpenJDK folder from that computer and on to the computer that couldn’t install the JDK in the first place.

I am having the same issue
Unity hub version 2.3.2
Unity editor version 2019.4.4f1
I have tried adding modules in the unity hub but it stops midway and then the download progress bar suddenly disappears
the main problem is that i can even download jdk manually
I tried Java SE Development Kit 8u261 but unity still says "incompatible java version ‘8’ android development requires JDK8 (1.8).
I hope unity will find a solution to our problem quick.

problem fixed here : Unity 2020 Android Support: Setup, SDK & NDK & JDK & Gradle - YouTube

Same problem 185811-myproblem.png

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
  10. Come back to Unity Editor and try to build the project.
  11. If you get a warning about obsolete Android SDK, click on Update SDK button.
  12. You Android build should be done after that (apk or aab). At least it built in my case.:slight_smile:

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.