zoukankan      html  css  js  c++  java
  • Android开发Failed to convert path to a short DOS path: C:\Windows\system32\java.exe

    今天基本完成了GPSMI客户端的工作,还有几张图片要处理下,然后就进入SDK的tools目录找到draw9patch.bat文件,运行时发现无法找到java.exe,出现一下信息。

     ERROR: No suitable Java found. In order to properly use the Android Developer
     Tools, you need a suitable version of Java JDK installed on your system.
     We recommend that you install the JDK version of JavaSE, available here:

     http://www.oracle.com/technetwork/java/javase/downloads

     You can find the complete Android SDK requirements here:
     http://developer.android.com/sdk/requirements.html

    刚开始还真以为是我的JDK版本问题,就开始卸载了jdk,从官网下载了最新的jdk 7,安装完成后发现还是同样的错误。

    怎么办呢?

    用编辑器打开draw9patch.bat发现这段代码,这个是用来查找java的。

    rem Check we have a valid Java.exe in the path.
    set java_exe=
    call lib\find_java.bat
    if not defined java_exe goto :EOF

    继续找到find_java.bat,用编辑器打开,将下面两行代码里面的的-s参数删除就可以了。

    or /f %%a in ('%~dps0\find_java.exe -s') do set java_exe=%%a

    for /f %%a in ('%~dps0\find_java.exe -s -w') do set javaw_exe=%%a

    替换成

    or /f %%a in ('%~dps0\find_java.exe') do set java_exe=%%a

    for /f %%a in ('%~dps0\find_java.exe -w') do set javaw_exe=%%a

    由于我使用的是window 7 x64 和jdk x64,都是64位的,使用32位的jdk应该不会有这个问题,如果你不想安装32位的jdk可以试试我的方法。

  • 相关阅读:
    Django ---uploads files
    powershell 更改为Oh-my-zsh
    Ubuntu server 安装Mysql
    Ubuntu下安装Python多版本开发环境
    python virtualenv 虚拟开发环境
    csv文件操作
    Could not load file or assembly ADODB, Version=7.0.3300.0
    sqlserver 循环截取字段中的某些字符
    JSON序列化的长度
    为何HttpContext.Current为NULL
  • 原文地址:https://www.cnblogs.com/thinkfeed/p/2619748.html
Copyright © 2011-2022 走看看