Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JDK directory is not set or invalid (unity)?

Tags:

java

I am now creating a keystore for my game (in unity) but when I press the add key button, an error pops up

Java Development Kit (JDK) directory is not set or invalid. Please, fix it in Preferences -> External Tools UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

I installed the JDK and checked the path of it in the terminal using the command /usr/libexec/java_home, then it shows me that the path of the JDK is /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home.

I copy and paste it in the JDK path in unity but the error still pops up. I actually checked the JavaVirtualMachines in my computer's library but there's nothing in it.

How can I solve this problem? Any help is greatly appreciated.

like image 533
Jelly Qwerty Avatar asked May 18 '20 08:05

Jelly Qwerty


People also ask

Where is Java path in Android Studio?

Navigate to File > Project Structure > SDK Location. Upon navigating there you will find that a tab named “JDK Location”, select that and then you can set the JDK path for the current project on which you're working.


1 Answers

Actually I solve this problem by adding the modules (Android SDK & NDK Tools, OpenJDK) to my Unity Editor. Actually if you tick the Android build support module, it won't automatically help you to tick the two modules above.

like image 106
Jelly Qwerty Avatar answered Sep 20 '22 15:09

Jelly Qwerty