Eclipse android sdk 包无法打开 Android SDK 管理器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13466572/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse android sdk bundle can't open Android SDK Manager
提问by DrNutsu
I downloaded new Android and Eclipse bundle in my new notebook (Window 7 64 bit) then I open my old files that I used to work in PC.When I open, it shows some error about version API and that I should fix it in SDK Manager, But when I try to open the SDK Manager it won't run and shows this error in console.
我在我的新笔记本(Window 7 64 位)中下载了新的 Android 和 Eclipse 包,然后我打开我以前在 PC 上工作的旧文件。当我打开时,它显示一些关于版本 API 的错误,我应该在 SDK 中修复它管理器,但是当我尝试打开 SDK 管理器时,它不会运行并在控制台中显示此错误。
[2555-11-20 10:27:27 - Dex Loader] SecurityException: Unable to find field for dex.jar
[2555-11-20 10:36:02 - SDK Manager] [SDK Manager] Failed to convert path to a short DOS path: C:\Windows\system32\java.exe
How can i fix that ??
我该如何解决?
回答by Freak
In android_sdk\tools\lib
there's a batch-file called find_java.bat
. It calls find_java.exe -s
to find a list of potential Java locations. Running the exe
file like this returns the error I've been seeing:
在android_sdk\tools\lib
那里有一个名为find_java.bat
. 它调用find_java.exe -s
以查找潜在 Java 位置的列表。exe
像这样运行文件会返回我一直看到的错误:
Failed to convert path to short DOS path: c:\windows\system32\java.exe
-s
stands for short. Running it without the -s
causes find_java.exe to work, causing find_java.bat to work, causing everything else to work. So the fix was to edit find_java.bat, and remove the -s
.
-s
代表简称。运行它而不-s
导致 find_java.exe 工作,导致 find_java.bat 工作,导致其他一切工作。所以修复是编辑 find_java.bat,并删除-s
.
回答by Yugandhar
Try this:
尝试这个:
go to adt-bundle-windows\sdk\tools
Right-click on
android.bat
and say "Run as Administrator"
转到 adt-bundle-windows\sdk\tools
右键单击
android.bat
并说“以管理员身份运行”
It will open up the sdk manager.
它将打开 sdk 管理器。
回答by user5221652
Need help with SDK it boots up but the dos flashes open and closes fast. I installed the 7.1 79 Java on my Windows 32 bit desktop. I installed the Android and Eclipse bundle. I tried running android.bat
by administrator. I tried this for Windows.
需要有关 SDK 的帮助才能启动,但 dos 会快速打开和关闭。我在 Windows 32 位桌面上安装了 7.1 79 Java。我安装了 Android 和 Eclipse 包。我尝试android.bat
通过管理员运行。我在 Windows 上试过这个。
You need to create an environment variable called JAVA_HOME
and set it to your JDK installed directory.
您需要创建一个名为的环境变量JAVA_HOME
并将其设置为您的 JDK 安装目录。
First, take note of your JDK installed directory. The default is c:\Program Files\Java\jdk1.8.0_{xx}
, where {xx} is the latest upgrade number. It is important to verify your JDK installed directory, via the Computer, before you proceed further.
首先,记下您的 JDK 安装目录。默认为c:\Program Files\Java\jdk1.8.0_{xx}
,其中 {xx} 是最新的升级编号。在继续下一步之前,通过计算机验证您的 JDK 安装目录非常重要。
Start a CMD shell, and issue the command set JAVA_HOME
to check if variable JAVA_HOME
has been set:
启动一个 CMD shell,并发出命令set JAVA_HOME
来检查是否JAVA_HOME
已设置变量:
> set JAVA_HOME
Environment variable JAVA_HOME
not defined
If JAVA_HOME
is set, check if it is set to your JDK installed directory correctly. Otherwise, goto next step.
环境变量JAVA_HOME
未定义 如果JAVA_HOME
设置了,请检查是否正确设置到您的JDK安装目录。否则,转到下一步。
To set the environment variable JAVA_HOME
in Windows 2000/XP/Vista/7/8:
JAVA_HOME
在 Windows 2000/XP/Vista/7/8 中设置环境变量:
Push Start
button ? Control Panel ? System ? (Vista/7/8) Advanced system settings ? Switch to "Advanced" tab ? Environment Variables ? System Variables ? "New" (or "Edit" for modification) ? In "Variable Name", enter "JAVA_HOME" ? In "Variable Value", enter your JDK installed directory (e.g., "c:\Program Files\Java\jdk1.8.0_{xx}").
按下Start
按钮?控制面板 ?系统 ?(Vista/7/8) 高级系统设置?切换到“高级”选项卡?环境变量 ?系统变量 ? “新建”(或“编辑”进行修改)?在“变量名”中,输入“JAVA_HOME”?在“变量值”中,输入您的 JDK 安装目录(例如,“c:\Program Files\Java\jdk1.8.0_{xx}”)。
To verify, RE-START a CMD shell (need to refresh the environment) and issue:
要验证,请重新启动 CMD shell(需要刷新环境)并发出:
set JAVA_HOME
I also tried opening the android.bat and editing it with my java 7.1.79.
我还尝试打开 android.bat 并使用我的 java 7.1.79 对其进行编辑。
回答by darrellh
If you have Android studio loaded it kills the contents of the ~/android.bat and most other files in the sdk directory that the SDKManager needs to run. I had to install the Android SDK in a secondary directory, then copy over the contents into my actual SDK directory. This allows the SDKManager in Eclipse to function again and keeps your SDK updates. If you install Eclipse after installing Android Studio, then this problem does not occur.
如果您加载了 Android Studio,它会杀死 SDKManager 需要运行的 ~/android.bat 和 sdk 目录中的大多数其他文件的内容。我必须在二级目录中安装 Android SDK,然后将内容复制到我的实际 SDK 目录中。这允许 Eclipse 中的 SDKManager 再次运行并保持您的 SDK 更新。如果在安装Android Studio 后安装Eclipse,则不会出现此问题。
回答by Satish
Removed all existing eclipse & android versions
删除了所有现有的 eclipse 和 android 版本
I downloaded latest version of eclipse & latest android SDK ..and installed them..
我下载了最新版本的 eclipse 和最新的 android SDK ..并安装了它们..
Took me 30 mins which was better than being stiuck for more than 3 days even after trying all procedures mentioned in various blogs & links...
即使在尝试了各种博客和链接中提到的所有程序后,我还是花了 30 分钟,这比坚持 3 天以上要好……
Try above as the last option
尝试以上作为最后一个选项