- Home /
Unity will not accept JDK
Hi,
I'm trying to set up for android building and to test on my android device. But no matter what I seem to try, I can't get it to connect to the JDK. I've tried installing Unity 2018.2, 2019.3 and 2019.4 now and in the installs through Unity Hub, I've checked OpenJDK. Every install, the JDK folder stays empty and when I go to add it as a module, it says installing and then seems to be done, but the folder stays empty and next time I check it wants me to download again, so using the HUB is a no go it seems.
So I've tried to go the route of downloading from Oracle directly and linking in Preferences > External Tools. But when I do this, it shows me this error (if the image doesn't show, the error is "Incompatible Java version '8'. Android development requires JDK 8 (1.8) 64-bit.":
So I'm not sure what else to try. The hub doesn't fix it for me, and even if I manually download and set any of the JDK 8 versions from Oracle, it still gives me this error. I don't know how to specifically find 1.8 because when I search for that online, it comes back with JDK 8 and hundreds of different versions: https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html
So I either need to know which specific JDK 8 on that list 1.8 is so that it'll recognise it, or some other solution. I've been trying to solve for days now and just can't get through.
Thanks so much in advance!
are you sure that after using unity hub to install openJDK the checbox under edit
Yes, and it begins to install the module for approx 20 seconds, then just gives up. I can attempt is as many times as I like, and it'll always attempt the install and then just stop.
Can you check if the directory C/ProgramFiles/UnityEditor/YOURVERSION\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK exists?
Answer by KushagraPratap · Mar 10, 2021 at 02:39 AM
I was having the same error and I think I just solved it. Try downloading 64 bit version. Download the one having name x64 rather than x86.
Your answer
Follow this Question
Related Questions
Java error when building 1 Answer
Android - Failed to sign APK package: Unsupported major.minor version 52.0 {SOLVED} 1 Answer
Failed to recompile android resource files. 1 Answer
Extending the UnityPlayerActivity Java Code fail to build 1 Answer
DLL plugins unsupported for Android Application Building 0 Answers