Search Unity

Unity Hub CLI - OpenJDK

Discussion in 'Unity Hub' started by MikuriChan, Jan 7, 2020.

  1. MikuriChan

    MikuriChan

    Joined:
    Sep 3, 2018
    Posts:
    5
    Hello,

    With the Unity Hub CLI,
    In the headless help of the app, I can't find the command to install OpenJDK for Android.
    Doesn't work with "-m openjdk" logic.
    Also, the command "-m standardassets" seems broken.

    Code (BatchFile):
    1. "C:\Program Files\Unity Hub\Unity Hub.exe" -- --headless install-modules --version 2019.2.17f1 -m openjdk -m standardassets -m android -m android-sdk-ndk-tools
    Gives:
    Code (Console):
    1. Missing module openjdk. Skipping..
    2. Missing module standardassets. Skipping..
    The other modules are fine.

    Thank you.
     
  2. Kamand0l

    Kamand0l

    Joined:
    May 19, 2014
    Posts:
    24
    The same here, in version 2019.3.0f6 OpenJDK is not installed anymore when installing android + android-sdk-ndk-tools modules
     
  3. Ericroy

    Ericroy

    Joined:
    Oct 9, 2010
    Posts:
    11
    Same here, too. Very frustrating.
     
  4. jamiebrynes

    jamiebrynes

    Joined:
    Sep 12, 2017
    Posts:
    18
    I ran into the same problem when upgrading from 2019.2 to 2019.3.

    I eventually found that the OpenJDK module is called
    android-open-jdk
    which you need to install along with
    android
    and
    android-sdk-ndk-tools
    .
     
    Kamand0l likes this.
  5. ics_de

    ics_de

    Joined:
    Dec 6, 2017
    Posts:
    27
    Hi guys, I found the solution. Just like @jamiebrynes kinda said, the OpenJDK doesn't automatically install even when installing the Android Build Support. In my case, I discovered the circled checkbox wasn't check. This window appears in Unity Hub>Installs>(Right-click on the desired version)>Add Modules. You just need to toggle the checkbox and click "Done".

    Hope this helps!

    upload_2020-3-24_16-32-52.png
     
  6. compilersbro

    compilersbro

    Joined:
    Mar 19, 2020
    Posts:
    1
    I still have the problem !!?? It tries to install and after a while nothing happens and the check box is unchecked and also in the preferences it says "JDK not installed" ??
    Thank You !!
     
    MrTruth0 likes this.
  7. MrTruth0

    MrTruth0

    Joined:
    Jul 15, 2012
    Posts:
    4
    I have your same problem :L Unity Hub "Download" and "Install" OpenJDK
    upload_2020-4-22_4-1-22.png
    But after the "Installation", OpenJDK still doesn't exists
    upload_2020-4-22_4-11-1.png
    upload_2020-4-22_4-11-40.png upload_2020-4-22_4-11-50.png
     
    Last edited: Apr 22, 2020
  8. Ingkilla

    Ingkilla

    Joined:
    May 1, 2020
    Posts:
    3
    Same problem here guys. Anyone managed to fix this?
     
  9. FayytIgnatti

    FayytIgnatti

    Joined:
    Apr 3, 2020
    Posts:
    4
    Grr. After searching online, and going back to the Java website searching for answers, I stumbled upon this: upload_2020-5-5_20-23-44.png

    It seems those of us who are having trouble downloading the JDK might be in the unauthorized countries. I downloaded JDK 14 just fine, but Unity rejected it, and requested JDK 8, which is how I found this charming notice.
     
    paruthi-exe likes this.
  10. FayytIgnatti

    FayytIgnatti

    Joined:
    Apr 3, 2020
    Posts:
    4
    UPDATE: StackOverflow for the win! https://stackoverflow.com/questions/52929234/how-to-install-openjdk-8-in-windows-64-bit-os

    Searched a bit more, and found this post on stackOverflow. You can follow the links and download Amazon Correto JDK 8. I downloaded, and installed it to the recommended directory (not unity; something like c:\\program file\Amazon Coretto). I restarted my project from Unity Hub, and in Edit -> Preferences -> JDK, it had already automatically detected the presence of JDK 8. I just accepted it, and built my game.

    PROBLEM SOLVED.
     
  11. SkayGames

    SkayGames

    Joined:
    Nov 5, 2018
    Posts:
    1
    Same problem just happaned to me yesterday when i updated Unity from 2019.2 to 2019.3, is there any solution to this problem ?

    SOLVED :

    I've found the solution of this problem, i think this is a bug from UnityHub, so the only way is to install openJDK 8 (1.8) manual, Here the steps i did :

    1. Go to download openJDK 8 (1.8) from Oracle this is the LINK : https://www.oracle.com/java/technologies/javase-jdk8-downloads.html

    2. Install it after it's all DONE.

    3. Go Open Unity => Edit => Preferences => External Tools => Uncheck JDK Installed with Unity and click Browse => Go to this path "C:\Program Files\Java\jdk1.8.0_251".

    i hope this helped you guys <3.
     
    Last edited: May 19, 2020
  12. pracakmiecik

    pracakmiecik

    Joined:
    May 19, 2020
    Posts:
    2
    Hi previous answer almost work for me, still had some issue, but this helped me:


    Download newest sdk 8 (for this moment sdk 8u251).
    Install it
    Go to the folder where it been installed.
    There should be 2 folders jdk and jre.
    Open jdk folder, copy everything from it and paste it in default unity jdk folder.

    If you don't know how to find path: open unity -> Edit - > Preferences.. -> External Tools -> JDK Installed with Unity (copy path).

    Hopefully it's gonna help you guys.
     
  13. Vosko19

    Vosko19

    Joined:
    May 19, 2020
    Posts:
    1
    I found a solution, If you already have the JDK installed, just put the path of JDK in Unity.

    Edit -> Preferences -> Android

    upload_2020-5-18_20-57-17.png
     
  14. dmax9

    dmax9

    Joined:
    Jun 10, 2015
    Posts:
    6
    I'm working on a cruise ship and our internet connection is over satellite. As such our exit node is in Dubai and often Google switch to the Arabic language as per IP address it sees it as the current location. So, this can explain the country issue (in my case). Still, this is annoying. At the moment, I don't have any VPN subscriptions to this theory.
     
  15. scar027

    scar027

    Joined:
    May 23, 2018
    Posts:
    5
    I know this is an old thread, but it's one of the top results in search engines, so I thought I would share. I downloaded OpenJDK 64-bit for Windows from this website: https://adoptopenjdk.net/upstream.html?variant=openjdk8&ga=ga. I just extracted it to c:\Java (it can be anywhere you want) and pointed Unity to it like others have suggested.