Choose a Valid JDK Directory

◇◆丶佛笑我妖孽 提交于 2021-02-05 08:25:07

问题


My question is about an error in Android Studio.

I'm getting a JDK error whenever i try to build my app because Android Studio is struggling ti find where the JDK is installed.

How can i fix this error? Thanks


回答1:


You can use cmd + ; for Mac or Ctrl + Alt + Shift + S for Windows/Linux to pull up the Project Structure dialog. In there, you can set the JDK location as well as the Android SDK location.

Project Structure Dialog

Use embedded JDK or else point to your JDK directory. To get your JDK location, run /usr/libexec/java_home -v 1.7 in terminal. Send 1.7 for Java 7 or 1.8 for Java 8.




回答2:


1) Download JDK

2) Android Studio -> File -> Project structure -> JDK location. Point at where you have installed it.



来源:https://stackoverflow.com/questions/55845463/choose-a-valid-jdk-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!