简体   繁体   English

即使安装了JDK 8,Android工作室也无法安装

[英]Android studio not installing even if JDK 8 is installed

I just downloaded Google's new android studio bundle(x64 for Windows) and also installed JDK8 (C:\\Program Files\\Java\\jdk1.8.0_25) (x64 version). 我刚刚下载了Google的新Android工作室软件包(适用于Windows的x64),还安装了JDK8(C:\\ Program Files \\ Java \\ jdk1.8.0_25)(x64版本)。

But on the android studio setup it does not detect JDK and asks to locate its path. 但是在android studio设置中,它不会检测JDK并要求找到它的路径。 I located its path but still it says it is not valid. 我找到了它的路径,但它仍然说它无效。

I tried declaring new Environment variables (both system and User) but still I get same error. 我尝试声明新的环境变量(系统和用户),但我仍然得到相同的错误。

I also tried in cmd, and it says that java & JDK is installed. 我也试过cmd,它说安装了java和JDK。

After that I reinstalled JDK 8 for windows x64 from Oracle. 之后,我从Oracle重新安装了Windows x64的JDK 8。 But no changes in android studio... 但android studio没有变化......

Please Help. 请帮忙。 !

I had the same problem. 我有同样的问题。 I discovered that it was caused because I installed the JDK while the Android Studio installer was still opened and at the prompt to load the location of the JDK. 我发现这是因为我安装了JDK,而Android Studio安装程序仍然打开,并且提示加载JDK的位置。 Closing the Android installer and then reloading it after the JDK installation had completed and was closed out, solved the installation problem for me. 关闭Android安装程序,然后在JDK安装完成后重新加载并关闭,解决了我的安装问题。

While running Java 6 something I tried to install Android Studio. 在运行Java 6时,我尝试安装Android Studio。 Android Studio did not find Java 7 or Java 8, so it asked me to install at least Java 7 and gave a link to Java 7. While the original instance of Android Studio Installer was still alive, it would not find Java 7 or 8. killing and restarting Android Studio Installer worked just fine. Android Studio没有找到Java 7或Java 8,因此它要求我至少安装Java 7并提供Java 7的链接。虽然Android Studio Installer的原始实例仍然存在,但它找不到Java 7或8。杀死并重新启动Android Studio Installer工作正常。 So install Java and restart the installer. 所以安装Java并重启安装程序。

I have same error but i closely look into the note and then my problem solved :) 我有相同的错误,但我仔细查看说明,然后我的问题解决了:)

在此输入图像描述

It needs JDK 7, as stated on the System Requirements page: http://developer.android.com/sdk/index.html#Requirements 它需要JDK 7,如系统要求页面所述: http//developer.android.com/sdk/index.html#Requirements

Update: 更新:

For Android Studio 2.1, it needs JDK 8 for Windows or Linux, and JDK 6 for Mac. 对于Android Studio 2.1,它需要适用于Windows或Linux的JDK 8和适用于Mac的JDK 6。

Try following steps if it works. 如果有效,请尝试以下步骤。

  1. goto the AndroidStudio installation folder. 转到AndroidStudio安装文件夹。
  2. goto bin folder and open studio.bat in text editor add set JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0//your java path goto bin文件夹并在文本编辑器中打开studio.bat添加集JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0//your java path
  3. goto Start -> All Programmes -> Android Studio -> Right click on Android Studio and click on properties . 转到Start -> All Programmes -> Android Studio -> 右键单击 Android Studio并单击 properties
  4. You will see the Target like < installation path>android-studio\\bin\\studio64.exe change it to <installation path>android-studio\\bin\\studio.bat 您将看到目标如< installation path>android-studio\\bin\\studio64.exe将其更改为<installation path>android-studio\\bin\\studio.bat

I solved this problem by closing the installation file, and open it again as an administrator. 我通过关闭安装文件解决了这个问题,并以管理员身份再次打开它。 Pre over the need to set jdk. 预先设置jdk。

在我的情况下,我使用java8并基于Doc我只需要添加以下内容:

 implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"

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

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