微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > win8下Android SDK环境变量安装

win8下Android SDK环境变量安装

时间:09-12 来源:互联网 点击:

king 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和环境变量的配置就结束了。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top