在 Windows 7 上安装 Android Studio 失败,找不到 JDK

Android Studio installation on Windows 7 fails, no JDK found(在 Windows 7 上安装 Android Studio 失败,找不到 JDK)

本文介绍了在 Windows 7 上安装 Android Studio 失败,找不到 JDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了 Android Studio 并尝试启动该程序.

I downloaded Android Studio and attempted to launch the program.

这是在带有 Java 1.7 的 64 位 Windows 7 上运行的.在安装过程中,我的 Java 1.7 被检测到,安装的其余部分正常进行.但是,当尝试从桌面图标启动应用程序时,没有任何反应.查看任务管理器,从 CMD 加载了一个新进程.这是因为它试图运行批处理文件 studio.bat.

This is running on Windows 7 64-bit with Java 1.7. During the installation my Java 1.7 is detected, and the rest of the installation goes through just fine. However, when attempting to launch the application from the desktop icon, nothing happens. Looking at the task manager, a new process from the CMD is loaded. This is because it's attempting to run the batch file studio.bat.

当我通过 CMD 执行时,出现以下错误:

When I execute via CMD, I get the following error:

错误:无法启动 Android Studio.未找到 JDK.请验证ANDROID_STUDIO_JDK 或 JDK_HOME 或 JAVA_HOME 指向有效JDK安装.ECHO 关闭.按任意键继续 ...

ERROR: cannot start Android Studio. No JDK found. Please validate either ANDROID_STUDIO_JDK, or JDK_HOME or JAVA_HOME points to valid JDK installation. ECHO is off. Press any key to continue . . .

我试图打开 idea 属性文件,看看是否有我可以为这个 ANDROID_STUDIO_JDK 或类似的东西配置的东西.然而,我什么也没发现.我希望你们中的一些人可以让我知道您是否能够安装它或者您是否也遇到了问题.

I've attempted to open the idea properties file to see if there was something I could configure for this ANDROID_STUDIO_JDK or something like that. However, I found nothing. I hope some of you can let me know if you were able to install this or if you are having problems as well.

推荐答案

添加一个系统变量JDK_HOME,其值为c:Program FilesJavajdk1.7.0_21 为我工作.最新的 Java 版本可以在这里下载.

Adding a system variable JDK_HOME with value c:Program FilesJavajdk1.7.0_21 worked for me. The latest Java release can be downloaded here.

此外,请确保变量 JAVA_HOME 也设置为上述位置.

Additionally, make sure the variable JAVA_HOME is also set with the above location.

这篇关于在 Windows 7 上安装 Android Studio 失败,找不到 JDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:在 Windows 7 上安装 Android Studio 失败,找不到 JDK