Android sdk 秒退 win8

K-2SO 2012-09-01 09:05:49
前两天装了win8 今天开始配置Java和eclipse都很正常包括ADT插件 但是装完installer_r20.0.3-windows.exe 也检测的到jdk了装完运行出来cmd窗口然后秒退 不能运行~已经重装好多次了 求解啊 要不作业不能做了~
...全文
746 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
dream0963 2013-06-07
  • 打赏
  • 举报
回复
引用 4 楼 ilittleone 的回复:
[Quote=引用 3 楼 的回复:] 引用 2 楼 的回复: http://dl.google.com/android/android-sdk_r20.0.3-windows.zip 楼主可以直接使用zip包下载,sdk下面的find_java有点bug 不行啊 还是秒退~ [/Quote]
D:\Program Files\android-sdk-windows\tools\lib
这个目录下修改 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

这个有用 刚试了可以哦
yeahcn 2012-10-14
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 的回复:]

win8 64 pro木问题的高调路过,你还是只用cmd跑看看报错是什么
[/Quote]

请问你的C:\Windows\System32目录下有java.exe javaw.exe javaws.exe这三个东西没?
貌似是这个位置的java.exe是的find java失败了
K-2SO 2012-10-14
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 的回复:]

引用楼主 的回复:
前两天装了win8 今天开始配置Java和eclipse都很正常包括ADT插件 但是装完installer_r20.0.3-windows.exe 也检测的到jdk了装完运行出来cmd窗口然后秒退 不能运行~已经重装好多次了 求解啊 要不作业不能做了~


楼主这个问题解决了没啊
你装的是专业版的还是企业版的系统?
[/Quote]

哈哈 刚刚解决~~就是刚刚 自己解决了 Java的安装路径不能有空格。。。。。。。。。就是这样。是pro版
yeahcn 2012-10-14
  • 打赏
  • 举报
回复
[Quote=引用楼主 的回复:]
前两天装了win8 今天开始配置Java和eclipse都很正常包括ADT插件 但是装完installer_r20.0.3-windows.exe 也检测的到jdk了装完运行出来cmd窗口然后秒退 不能运行~已经重装好多次了 求解啊 要不作业不能做了~
[/Quote]

楼主这个问题解决了没啊
你装的是专业版的还是企业版的系统?
兔子和小鱼干 2012-10-12
  • 打赏
  • 举报
回复
win8 64 pro木问题的高调路过,你还是只用cmd跑看看报错是什么
yeahcn 2012-10-12
  • 打赏
  • 举报
回复
大神啊,来拯救下我吧
Win8 64位有同样的问题..........
K-2SO 2012-09-13
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 的回复:]

引用 3 楼 的回复:

引用 2 楼 的回复:

http://dl.google.com/android/android-sdk_r20.0.3-windows.zip
楼主可以直接使用zip包下载,sdk下面的find_java有点bug

不行啊 还是秒退~


Assembly code
D:\Program Files\android-sdk-windows……
[/Quote]
还是不行 估计就是系统问题 path也对的 find_java也能找到jdk 但是就是运行不了 在win7 64 就可以
「已注销」 2012-09-13
  • 打赏
  • 举报
回复
我win8下运行也秒退,同求解决
兔子和小鱼干 2012-09-02
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]

引用 2 楼 的回复:

http://dl.google.com/android/android-sdk_r20.0.3-windows.zip
楼主可以直接使用zip包下载,sdk下面的find_java有点bug

不行啊 还是秒退~
[/Quote]

D:\Program Files\android-sdk-windows\tools\lib
这个目录下修改 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

K-2SO 2012-09-02
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

http://dl.google.com/android/android-sdk_r20.0.3-windows.zip
楼主可以直接使用zip包下载,sdk下面的find_java有点bug
[/Quote]
不行啊 还是秒退~
兔子和小鱼干 2012-09-02
  • 打赏
  • 举报
回复
http://dl.google.com/android/android-sdk_r20.0.3-windows.zip
楼主可以直接使用zip包下载,sdk下面的find_java有点bug
xqhrs232 2012-09-02
  • 打赏
  • 举报
回复
就在玩WIN8?

80,491

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧