文档章节

win8下Android SDK环境变量安装

EDIAGD
 EDIAGD
发布于 2013/07/08 17:10
字数 1259
阅读 9679
收藏 6

一:

下载 Android SDK

http://developer.android.com/sdk/index.html

这里有两种,一种是下载“ADT Bundle for Windows” ,这是个已经集成好的Eclipse开发环境,已经配置好所有的东西,只需要做安装JDK和配置环境变量。

还有一种就是自己有Eclipse只是想单独下载Android SDK的。这种情况请选择“USE AN EXISTING IDE”,下载SDK Tools For Windows。

二:安装Android SDK

这里我解压下载的:ADT Bundle for Windows文件得到:adt-bundle-windows-x86_64-20130522目录

选择好安装目录,一路下一步就行了,注意:如果你没有配置JAVA_HOME环境变量,Android SDK安装检测可能会报错。

配置Android SDK环境变量,这个是一个很容易出错的地方,如果只是下载了“ADT Bundle for Windows”,没有配置这个环境变量的话,那么在启动虚拟机AVD的时候可能会出错。

ANDROID_SDK_HOME:设置你Android SDK的安装目录就行了。我的是:D:\Android\android-sdk

PATH:把“%ANDROID_SDK_HOME%\tools;%ANDROID_SDK_HOME%\platform-tools;” 添加到系统环境变量path下。

三:在adt-bundle-windows-x86_64-20130522目录下运行SDK Manager.exe

发现:

WIN8下的Android SDK 秒退了

解决办法: 找到Android SDK的安装目录下 android-sdk-windows/tools/lib/find_java.bat批处理文件,备份一下。(随便重命名,更改后缀格式)。
然后新建同名格式文件,将以下内容粘贴复制,保存即可。
然后,启动 SDK Manager ,可以打开窗口。

find_java.bat中全部替换成下面的:

@echo off
rem Copyright (C) 2007 The Android Open Source Project
rem
rem Licensed under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with the License.
rem You may obtain a copy of the License at
rem
rem      http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.
 
rem This script is called by the other batch files to find a suitable Java.exe
rem to use. The script changes the "java_exe" env variable. The variable
rem is left unset if Java.exe was not found.
 
rem Useful links:
rem Command-line reference:
rem   http://technet.microsoft.com/en-us/library/bb490890.aspx
 
rem Check we have a valid Java.exe in the path. The return code will
rem be 0 if the command worked or 9009 if the exec failed (program not found).
rem Java itself will return 1 if the argument is not understood.
set java_exe=java.exe
rem search it in the path and verify we can execute it
for %%a in (%java_exe%) do set java_exe=%%~s$PATH:a
if not exist %java_exe% goto SearchForJava
%java_exe% -version 2>nul
if ERRORLEVEL 1 goto SearchForJava
goto :SearchJavaW
 
 
rem ---------------
:SearchForJava
rem We get here if the default %java_exe% was not found in the path.
rem Search for an alternative in %ProgramFiles%\Java\*\bin\java.exe
 
echo.
echo WARNING: Java not found in your path.
 
rem The strategy is to look for Java under these 3 locations:
rem - %ProgramFiles%, which may point to either a 32-bit or 64-bit install
rem                   depending on the current invocation context
rem - %ProgramW6432%, which points to a 32-bit install. This may not be defined.
rem - %ProgramFiles(x86)%, which points to a 64-bit install. This may not be defined.
 
if not defined ProgramFiles goto :Check64
echo Checking if Java is installed in %ProgramFiles%\Java.
 
set java_exe=
for /D %%a in ( "%ProgramW6432%\Java\*" ) do call :TestJavaDir "%%a"
if defined java_exe goto :SearchJavaW
 
rem Check for the "default" 64-bit version if it's not the same path
:Check64
if not defined ProgramW6432 goto :Check32
if "%ProgramW6432%"=="%ProgramFiles%" goto :Check32
echo Checking if Java is installed in %ProgramW6432%\Java instead (64-bit).
 
set java_exe=
for /D %%a in ( "%ProgramW6432%\Java\*" ) do call :TestJavaDir "%%a"
if defined java_exe goto :SearchJavaW
 
rem Check for the "default" 32-bit version if it's not the same path
:Check32
if not defined ProgramFiles(x86) goto :CheckFailed
if "%ProgramFiles(x86)%"=="%ProgramFiles%" goto :CheckFailed
echo Checking if Java is installed in %ProgramFiles(x86)%\Java instead (32-bit).
 
set java_exe=
for /D %%a in ( "%ProgramFiles(x86)%\Java\*" ) do call :TestJavaDir "%%a"
if defined java_exe goto :SearchJavaW
 
:CheckFailed
echo.
echo ERROR: No suitable Java found. In order to properly use the Android Developer
echo Tools, you need a suitable version of Java JDK installed on your system.
echo We recommend that you install the JDK version of JavaSE, available here:
echo   http://www.oracle.com/technetwork/java/javase/downloads
echo.
echo You can find the complete Android SDK requirements here:
echo   http://developer.android.com/sdk/requirements.html
echo.
goto :EOF
 
rem ---------------
:TestJavaDir
rem This is a "subrountine" for the for /D above. It tests the short version
rem of the %1 path (i.e. the path with only short names and no spaces).
rem However we use the full version without quotes (e.g. %~1) for pretty print.
if defined java_exe goto :EOF
set full_path=%~1\bin\java.exe
set short_path=%~s1\bin\java.exe
 
%short_path% -version 2>nul
if ERRORLEVEL 1 goto :EOF
set java_exe=%short_path%
 
echo.
echo Java was found at %full_path%.
echo Please consider adding it to your path:
echo - Under Windows XP, open Control Panel / System / Advanced / Environment Variables
echo - Under Windows Vista or Windows 7, open Control Panel / System / Advanced System Settings / Environment Variables
echo At the end of the "Path" entry in "User variables", add the following:
echo   ;%full_path%
echo.
goto :EOF
 
rem ---------------
:SearchJavaW
rem Called once java_exe has been set. Try to see if we can find a javaw
rem to use. If not, we'll default to using java_exe.
for %%a in (%java_exe%) do set p=%%~pa
for %%a in (%java_exe%) do set n=%%~na
for %%a in (%java_exe%) do set x=%%~xa
set n=%n:java=javaw%
set javaw_exe=%p%%n%%x%
if not exist %javaw_exe% set javaw_exe=%java_exe%
goto :EOF
 

闪退的解决办法二:

 

先用管理员身份运行SDK Manager.exe,这时候会出现闪退,再在解压之后的SKD文件夹里搜索 android.bat , 双击运行,这时候应该就会出现正常的程序窗口了

 

 

 

到此win8下安装 android sdk和环境变量的配置就结束了。

 

 

后续有很多开发填坑的文章发布,如果对你有帮助,请支持和加关注一下

http://e22a.com/h.05ApkG?cv=AAKHZXVo&sm=339944

https://shop119727980.taobao.com/?spm=0.0.0.0 

 

© 著作权归作者所有

共有 人打赏支持
EDIAGD
粉丝 49
博文 149
码字总数 58327
作品 0
嘉定
后端工程师
私信 提问
加载中

评论(1)

bygreencn
bygreencn
干脆做个脚本支持所以的Windows系统。
【QT5.1】Windows 下的 安卓开发环境配置

本文参考 http://qt-project.org/wiki/buildingqt-androidon_windows 本人开发环境: win8 64 位,win7 ,xp 应该更没有问题,注意选择 32 位 ,64位的区分 1. 安装 Perl http://strawberryperl...

冰星零
2013/07/06
0
0
Appium自动化测试系列1 - Appium环境的安装与配置

之前一直使用Robotium做为Android App测试框架的底层基础,受限于跨进程,以及控件加载的一些限制,很多特殊场景无法覆盖,决定尝试久闻的Appium(它也差不多成熟了),顺便做个笔记,方便其...

冬吃萝卜
2015/01/27
0
0
android SDK安装以及环境变量配置(windows)

一、下载安装android SDK 两种方式: (1)官网下载(需翻墙):https://developer.android.com/studio/index.html (2)无需翻墙下载:http://www.androiddevtools.cn/ 找到SDK Tools,选择下...

xiaomin0322
08/24
0
0
Android+eclipse+maven环境搭建

1.安装jdk,设置环境变量 略 2.安装android sdk 下载地址:http://developer.android.com/sdk/index.html 设置环境变量: 新建变量名:ANDROIDSDKHOME,变量值是android-SDK的路径:D:adt-bund...

ksfzhaohui
2014/04/20
0
0
安卓开发环境配置之Windows+ADT+eclipse

安卓环境搭建之Windows+ADT+eclipse 要点: 1.安装JDK 2.安装Android SDK 3.安装eclipse 4.安装ADT 5.安装调试环境 正文: 1.安装JDK 1.1准备JDK安装文件 1.2安装 1.3建立环境变量 CLASSPAT...

西风瘦
08/23
0
0

没有更多内容

加载失败,请刷新页面

加载更多

程序中设置MySQL的默认值

import com.alibaba.fastjson.JSON;import java.beans.PropertyDescriptor;import java.lang.annotation.*;import java.lang.reflect.Field;import java.lang.reflect.Method;impo......

laolin23
23分钟前
2
0
WordPress没有上级目录的写权限

sudo chmod -R 777 wordpress/wp-content

临江仙卜算子
31分钟前
4
0
大数据学习之大数据技术笔记—spring入门

篇一 spring介绍 spring.io 官网 快速开始 Aop 面向切面编程,可以任何位置,并且可以细致到方法上 连接框架与框架 Spring 就是 IOC AOP 思想 有效的组织中间层对象一般都是切入 service 层 ...

董黎明
32分钟前
5
0
ASP.NET Core MVC 静态文件配置

在启动文件中添加以下配置 public class Startup{ public IServiceProvider ConfigureServices(IServiceCollection services) { services.AddDirectoryBrowser(); ......

whltian
今天
2
0
linux之自定义命令

本人使用的是ubuntu系统,不喜欢建各种桌面快捷链接,但是每次启动个软件,去查找又麻烦,所以自定义了命令,来快捷的启动应用: 1、修改/etc/bash.bashrc,在文件末尾,加上如下List-1中的内...

克虏伯
今天
8
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部