zoukankan      html  css  js  c++  java
  • [Android] "Failed to find Java version for 'C:Windowssystem32java.exe"

    Impossible to install SDK r17 on win 7 x64

    "Failed to find Java version for 'C:Windowssystem32java.exe"问题的解决方法

    OS: Windows 7 x86 64bit
    JDK installed: http://download.oracle.com/otn-pub/java/jdk/7u3-b05/jdk-7u3-windows-x64.exe

    Option #1
    Execute Android SDK installer 
    http://dl.google.com/android/installer_r17-windows.exe

    Actual result - it can not find JAVA on the system. 

    Environment variable JAVA_HOME, PATH and recommendation from different forums about registry key didn't help (like here http://codearetoy.wordpress.com/2010/12/23/jdk-not-found-on-installing-android-sdk/)

    Option #2
    Execute tools/android.bat from 
    http://dl.google.com/android/android-sdk_r17-windows.zip

    Actual result:
    Failed to start with the error in console: "Failed to convert path to a short DOS path: C:Windowssystem32java.exe"

    How I fixed this: 
    In the file android-sdk-windows oolslibfind_java.bat 
    -for /f %%a in ('%~dps0find_java.exe -s') do set java_exe=%%a
    +for /f %%a in ('%~dps0find_java.exe') do set java_exe=%%a

    Suggestions - it is obvious that find_java.exe has a bug in conversion long names to short one (at least if no any conversion is required)

    红字部分为解决方法,这种方法需要使用zip包的Android SDK,而不能使用exe格式的,然后在android-sdk-windows oolslibfind_java.bat

    文件中:

    -for /f %%a in ('%~dps0find_java.exe -s') do set java_exe=%%a
    +for /f %%a in ('%~dps0find_java.exe') do set java_exe=%%a

    然后再运行android.bat就可以了。

  • 相关阅读:
    mysql 设置无密码登陆
    phpstudy mysql 升级5.7.18
    php 统计二维数组中某个相等值的总个数,并且组合成一个新的数组 转发
    centos 安装 composer
    PHP不定维数组去除空值
    jQuery中$.ajax()详解(转)
    JSON详解(转发自博客园)
    详解CMS垃圾回收机制
    内存管理
    什么是同源策略
  • 原文地址:https://www.cnblogs.com/Zblogs/p/3343578.html
Copyright © 2011-2022 走看看