简体   繁体   English

Android Studio表示未安装JDK 7,甚至已安装JDK 8

[英]Android Studio says JDK 7 isn't Installed, while JDK 8 is even installed

When I try to compile in Android Studio, the program says that sdkVersion 21 requires compiling with JDK is required. 当我尝试在Android Studio中进行编译时,程序显示sdkVersion 21需要使用JDK进行编译。 Although I installed JDK 7 (and later 8) and my terminal says that they were installed, only the 1.6.0.blabla version is visible as an installed Java Virtual Machine in my folders... How can I fix this? 尽管我安装了JDK 7(及更高版本的8),并且我的终端机说安装了它们,但是在我的文件夹中,只有1.6.0.blabla版本作为已安装的Java虚拟机可见...如何解决此问题?

Note that I am on Windows, so pathname format would be different, but rest of the steps should work fine. 请注意,我在Windows上,因此路径名格式会有所不同,但是其余步骤应该可以正常工作。

In Android Studio, go to: File > Project Structure > SDK Location and make sure that the JDK Location property has valid path pointing to JDK installed on your system. 在Android Studio中,转到:“ 文件”>“项目结构”>“ SDK位置” ,并确保“ JDK位置”属性具有指向系统上已安装的JDK的有效路径。

On Windows, that property value is "C:\\Program Files\\Java\\jdk1.7.0_55", so you can make a good guess as to what it should be on MacOS. 在Windows上,该属性值为“ C:\\ Program Files \\ Java \\ jdk1.7.0_55”,因此您可以很好地猜测MacOS上的属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM