错误:无法初始化类 com.android.sdklib.repositoryv2.AndroidSdkHandler [英] Error:Could not initialize class com.android.sdklib.repositoryv2.AndroidSdkHandler

查看:45
本文介绍了错误:无法初始化类 com.android.sdklib.repositoryv2.AndroidSdkHandler的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在启动时使用 Android Studio 构建此项目,但出错.Stacktrace 是这里

I want to build this project with Android Studio at launching, but take a error. Stacktrace is here

推荐答案

当你的系统中安装了多个 JDK 时出现这个问题,我遇到了同样的问题,因为我错误地安装了 oracle-jdk-9 而 Android studio 需要 oracle-jdk-8

This problem occurs when there are multiple JDKs installed in your system, I had the same issue as I had mistakenly installed oracle-jdk-9 and Android studio requires oracle-jdk-8

如果您使用的是 Ubuntu,则可以从 这个问题.

If you are using Ubuntu you can install jdk-8 from this question.

因此,进行以下更改,如下所示:

So, Make following changes as shown below:

ctrl+shift+alt+s 将打开项目结构,也可以从

Press ctrl+shift+alt+s that will open project structure which can also be opened from

文件 -> 项目结构

然后更改您可能已安装 JDK 8 的 JDK 位置

And then change JDK Location where you may have installed JDK 8

这篇关于错误:无法初始化类 com.android.sdklib.repositoryv2.AndroidSdkHandler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆