无法找到或加载主类com.android.sdkmanager.Main [英] Could not find or load main class com.android.sdkmanager.Main

查看:156
本文介绍了无法找到或加载主类com.android.sdkmanager.Main的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了这些以及有关Android SDK安装问题的这些问题.

没有任何东西对我有用.

Nothing works for me.

每次我得到错误

C:\Users\user\AppData\Local\Android\android-sdk\tools>android
Error: Could not find or load main class com.android.sdkmanager.Main

当我尝试启动android.bat时.

when I try to start android.bat.

我的环境:

C:\Users\user\AppData\Local\Android\android-sdk\tools>java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

JAVA_HOME=c:\Program Files\Java\jdk1.7.0_71\jre\bin

PATH=c:\Program Files\Java\jdk1.7.0_71\jre\bin\;%SystemRoot%\system32;%SystemRoot%;...

我使用最新的android SDK版本(2014年12月8日)-installer_r23.0.2-windows.exe,尝试使用最新的JDK7& JDK8构建.始终存在相同的错误.

I use latest android SDK version (on Dec 8, 2014) - installer_r23.0.2-windows.exe, tried to use latest JDK7 & JDK8 builds. Same error all the time.

该如何解决?

推荐答案

问题:

bat文件中所需的JAR位于路径%APP_HOME%\..\lib\sdkmanager-classpath.jar
但由于用于解压缩该文件的解压缩程序出现问题,因此该文件已提取到%APP_HOME%..\lib\_\sdkmanager-classpath.jar.

Issue:

The JAR required in in the bat file is in path %APP_HOME%\..\lib\sdkmanager-classpath.jar,
but the file was extracted to %APP_HOME%..\lib\_\sdkmanager-classpath.jar, due to an issue in the unzip program used to unzip it.

因此,请勿使用Windows的嵌入式解压缩工具.切换到另一个,例如7z.
然后将正确引用该目录,并且您可以运行sdkmanager.bat而不会出现错误.

So don't use the Windows' embedded unzip tool. Switch to another, like 7z.
The directory will then be referenced correctly, and you can run sdkmanager.bat without errors.

这篇关于无法找到或加载主类com.android.sdkmanager.Main的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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