SDK管理器不查看java

SDK管理器不查看java

本文介绍了SDK管理器不查看java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,伙计们,我似乎不断地无法手头解决这个问题,我的头不断成为巴尔德或巴尔德。

眼下的问题是,我的SDK经理不会找到我的Java,也不是我的SWT文件。

我运行Windows 7 64位和我的SDK,Java的,SWT被定位为如下。

 的Java JDK  -  C:\ Program Files文件\的Java \ jdk1.6.0_24
Java的位置 -  C:\ Program Files文件\的Java \ jdk1.6.0_24 \ jre的\ BIN
SDK管理器 -  C:\ Android的SDK-窗口
 

我学习编码的第一次,我已经尝试了一切至今。设置该SDK管理器指定,甚至试图设置多个的正确的路径,改变了批处理文件和这样的例子不胜枚举。

任何想法?

混沌的android


好吧,所以去掉了安装程序,用户设置的路径,这是我所得到的

  C:\用户\ MuniFC Portable11> C:\ Android的SDK-WINDOWS \工具\ android.bat
[信息]启动Android SDK和AVD管理
'的xcopy'不被识别为内部或外部的命令,
可运行的程序或批处理文件。
没有命令行参数的设置,启动界面。
见机器人--help'的命令行操作。
显示java.lang.NullPointerException
    在com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1205)
    在com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1184)
    在com.android.sdklib.internal.avd.AvdManager< INIT>(AvdManager.java:385)
    在com.android.sdkuilib.internal.repository.UpdaterData.initSdk(UpdaterData.java:238)
    在com.android.sdkuilib.internal.repository.UpdaterData< INIT>(UpdaterData.java:114)
    在com.android.sdkuilib.internal.repository.UpdaterWindowImpl< INIT>(UpdaterWindowImpl.java:86)
    在com.android.sdkuilib.repository.UpdaterWindow< INIT>(UpdaterWindow.java:42)
    在com.android.sdkmanager.Main.showMainWindow(Main.java:302)
    在com.android.sdkmanager.Main.doAction(Main.java:281)
    在com.android.sdkmanager.Main.run(Main.java:99)
    在com.android.sdkmanager.Main.main(Main.java:88)
 


将在合适的环境样品,并得到这个

  C:\用户\ MuniFC Portable11> C:\ Android的SDK-WINDOWS \工具\ android.bat
[信息]启动Android SDK和AVD管理
XCOPY不被识别为一个内部或外部命令,可操作的程序或批处理文件。
没有命令行参数的设置,启动界面。
见机器人--help'的命令行操作。
显示java.lang.NullPointerException
    在com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1205)
    在com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1184)
    在com.android.sdklib.internal.avd.AvdManager< INIT>(AvdManager.java:385)
    在com.android.sdkuilib.internal.repository.UpdaterData.initSdk(UpdaterData.java:238)
    在com.android.sdkuilib.internal.repository.UpdaterData< INIT>(UpdaterData.java:114)
    在com.android.sdkuilib.internal.repository.UpdaterWindowImpl< INIT>(UpdaterWindowImpl.java:86)
    在com.android.sdkuilib.repository.UpdaterWindow< INIT>(UpdaterWindow.java:42)
    在com.android.sdkmanager.Main.showMainWindow(Main.java:302)
    在com.android.sdkmanager.Main.doAction(Main.java:281)
    在com.android.sdkmanager.Main.run(Main.java:99)
    在com.android.sdkmanager.Main.main(Main.java:88)`
 


我的android.bat文件是为让

 `@回响
REM版权所有(C)2007年Android开源项目
REM
REM Apache许可证下授权,版本2.0(以下简称许可证);
REM您可能不能使用这个文件除了在遵守许可。
REM您可以在获得许可证的副本
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM除非适用法律要求或书面同意,软件
REM许可证下发布分布在原样的基础上,
REM无担保或任何形式的条件,无论是EX preSS或暗示的保证。
REM查看许可证的特定语言的管理权限和
许可下REM限制。

REM相关链接:
REM命令行参考:
REM http://technet.microsoft.com/en-us/library/bb490890.aspx

REM不修改调用者的环境
SETLOCAL

REM设置PROG是这个脚本的路径,包括下面的符号链接,
REM和设置progdir是其目录的完全合格的路径名。
设置PROG =%〜F0

之前,我们改变它REM抓住当前目录
集WORK_DIR =%CD%

REM更改当前目录和驱动器,其中的脚本,以避免
REM包含空格的目录问题。
CD / D%〜DP0


REM检查我们有一个有效的java.exe路径。
设置java_exe =
调用LIB \ find_java.bat
如果没有定义java_exe GOTO:EOF

设置jar_path =的lib \ sdkmanager.jar

基于当前的体系结构,REM SET SWT.JAR路径(x86或x86_64的)
FOR / F %%一个在(%java_exe%罐子的lib \ archquery.jar')并设置swt_path =的lib \ %%一个

如果%1%2==更新SDK转到StartUi
如果不是%1==GOTO EndTempCopy
:StartUi
    回声[INFO]启动Android SDK和AVD管理

    REM我们现在要创建一个临时目录来保存所有需要的jar文件
    REM运行Android的工具,将它们复制在temp目录,最后执行
    REM从该路径。我们这样做,只有在运行启动无
    REM参数,以显示SDK更新UI。这使得更新程序
    REM更新工具所在的目录更新自身的位置。

    集TMP_DIR =%TEMP%\ TEMP-Android的工具
    XCOPY%swt_path%%TMP_DIR%\%swt_path%/我/ E / C / G / R / Y / Q> NUL
    复制/ B / D / Y的lib \ android的prefs.jar%TMP_DIR%\ lib目录\> NUL
    复制/ B / D / Y的lib \ org.eclipse *%TMP_DIR%\ lib目录\> NUL
    复制/ B / D / Y的lib \ SDK *%TMP_DIR%\ lib目录\> NUL
    复制/ B / D / Y的lib \ common.jar%TMP_DIR%\ lib目录\> NUL
    复制/ B / D / Y的lib \公-COM preSS *%TMP_DIR%\ lib目录\> NUL

    REM jar_path和swt_path是相对于PWD所以我们并不需要对其进行调整,只是改变迪尔斯。
    设置tools_dir =%CD%
    CD / D%TMP_DIR%

:EndTempCopy

REM全球ANDROID_SWT总是覆盖SWT.JAR路径
如果定义ANDROID_SWT设置swt_path =%A​​NDROID_SWT%

如果存在%swt_path%GOTO的setpath
    回声错误:SWT文件夹%swt_path%不存在。
    回声请设置ANDROID_SWT为指向包含SWT.JAR所用平台的文件夹。
    GOTO:EOF

:的setpath
REM最后执行的是Java程序,并在这里结束。
打电话%java_exe%-Dcom.android.sdkmanager.toolsdir =%tools_dir%-Dcom.android.sdkmanager.workdir =%WORK_DIR%-classpath%jar_path%;%swt_path%\ SWT.JARcom.android.sdkmanager 。主要 %*

REM EOF`
 

变量如这样

  ANDROID_SWT =; C:\ Android的SDK-WINDOWS \工具\ lib目录\ x86_64的
 

解决方案

您使用的是专用的JRE的JDK是你的Java位置提示

  Java的位置 -  C:\ Program Files文件\的Java \ jdk1.6.0_24 \ jre的\ BIN
 

如果您已经安装了一个公共JRE(这是提供给所有的Java应用程序,而不是仅限于JDK)你的Java位置会是这样

  C:\ Program Files文件\的Java \ jre1.6.0_24 \斌
 

但是Android SDK Manager可以与私人的JRE工作。

尝试将 PATH 环境变量的Java。

请参阅
如何设置或更改PATH系统变量?
如何添加,在Windows中删除或修改环境变量7?

在您设置了 PATH 变化的开始 SDK的manager.exe

它应该现在的工作。


修改

正在设置PATH错误

 的Java JDK  -  C:\ Program Files文件\的Java \ jdk1.6.0_24
Java的位置 -  C:\ Program Files文件\的Java \ jdk1.6.0_24 \ jre的\ BIN
 

删除上述 PATH ,并设置 PATH

  C:\ Program Files文件\的Java \ jdk1.6.0_24 \ BIN
 

这应该工作。它适用于 jdk1.6.0_20


修改

你读

 在线程异常主要java.lang.UnsatisfiedLinkError中:无法加载32位JVM的64位SWT库
 

对于64位JVM上安装64位的JDK和设置相应的路径。


现在的问题是越来越长。
让这个问题地址 SDK管理器没有找到的Java 并张贴另一个问题,参照这个问题和其他特定的错误,你得到的。

Hey guys,I seem to continually be unable to fix the issue at hand and my head is continually becoming balder or balder.

The issue at hand is that my SDK manager won't find my Java, nor my SWT file.

I'm running Windows 7 64-bit and my SDK, Java, SWT are located as the following.

Java JDK  -  C:\Program Files\Java\jdk1.6.0_24
Java location  -  C:\Program Files\Java\jdk1.6.0_24\jre\bin
SDK manager -  C:\android-sdk-windows

I'm learning coding for the very first time, i've tried everything so far. Set the correct paths that the SDK manager specifies, even tried setting multiple ones, changing the batch files, and the list goes on.

Any ideas?

Chaotic android


Alright so removed the installer, set the paths, this is what i get

C:\Users\MuniFC Portable11>C:\android-sdk-windows\tools\android.bat
[INFO] Starting Android SDK and AVD Manager
'xcopy' is not recognized as an internal or external command,
operable program or batch file.
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.
java.lang.NullPointerException
    at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1205)
    at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1184)
    at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:385)
    at com.android.sdkuilib.internal.repository.UpdaterData.initSdk(UpdaterData.java:238)
    at com.android.sdkuilib.internal.repository.UpdaterData.<init>(UpdaterData.java:114)
    at com.android.sdkuilib.internal.repository.UpdaterWindowImpl.<init>(UpdaterWindowImpl.java:86)
    at com.android.sdkuilib.repository.UpdaterWindow.<init>(UpdaterWindow.java:42)
    at com.android.sdkmanager.Main.showMainWindow(Main.java:302)
    at com.android.sdkmanager.Main.doAction(Main.java:281)
    at com.android.sdkmanager.Main.run(Main.java:99)
    at com.android.sdkmanager.Main.main(Main.java:88)


Set at the right environmentals and got this

C:\Users\MuniFC Portable11>C:\android-sdk-windows\tools\android.bat
[INFO] Starting Android SDK and AVD Manager
'xcopy' is not recognized as an internal or external command, operable program or batch file.
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.
java.lang.NullPointerException
    at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1205)
    at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1184)
    at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:385)
    at com.android.sdkuilib.internal.repository.UpdaterData.initSdk(UpdaterData.java:238)
    at com.android.sdkuilib.internal.repository.UpdaterData.<init>(UpdaterData.java:114)
    at com.android.sdkuilib.internal.repository.UpdaterWindowImpl.<init>(UpdaterWindowImpl.java:86)
    at com.android.sdkuilib.repository.UpdaterWindow.<init>(UpdaterWindow.java:42)
    at com.android.sdkmanager.Main.showMainWindow(Main.java:302)
    at com.android.sdkmanager.Main.doAction(Main.java:281)
    at com.android.sdkmanager.Main.run(Main.java:99)
    at com.android.sdkmanager.Main.main(Main.java:88)`


My android.bat file is as so

`@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 Useful links:
rem Command-line reference:
rem   http://technet.microsoft.com/en-us/library/bb490890.aspx

rem don't modify the caller's environment
setlocal

rem Set up prog to be the path of this script, including following symlinks,
rem and set up progdir to be the fully-qualified pathname of its directory.
set prog=%~f0

rem Grab current directory before we change it
set work_dir="%cd%"

rem Change current directory and drive to where the script is, to avoid
rem issues with directories containing whitespaces.
cd /d %~dp0


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

set jar_path=lib\sdkmanager.jar

rem Set SWT.Jar path based on current architecture (x86 or x86_64)
for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a

if "%1 %2"=="update sdk" goto StartUi
if not "%1"=="" goto EndTempCopy
:StartUi
    echo [INFO] Starting Android SDK and AVD Manager

    rem We're now going to create a temp dir to hold all the Jar files needed
    rem to run the android tool, copy them in the temp dir and finally execute
    rem from that path. We do this only when the launcher is run without
    rem arguments, to display the SDK Updater UI. This allows the updater to
    rem update the tools directory where the updater itself is located.

    set tmp_dir=%TEMP%\temp-android-tool
    xcopy %swt_path% %tmp_dir%\%swt_path% /I /E /C /G /R /Y /Q > nul
    copy /B /D /Y lib\androidprefs.jar   %tmp_dir%\lib\        > nul
    copy /B /D /Y lib\org.eclipse.*      %tmp_dir%\lib\        > nul
    copy /B /D /Y lib\sdk*               %tmp_dir%\lib\        > nul
    copy /B /D /Y lib\common.jar         %tmp_dir%\lib\        > nul
    copy /B /D /Y lib\commons-compress*  %tmp_dir%\lib\        > nul

    rem jar_path and swt_path are relative to PWD so we don't need to adjust them, just change dirs.
    set tools_dir=%cd%
    cd /d %tmp_dir%

:EndTempCopy

rem The global ANDROID_SWT always override the SWT.Jar path
if defined ANDROID_SWT set swt_path=%ANDROID_SWT%

if exist %swt_path% goto SetPath
    echo ERROR: SWT folder '%swt_path%' does not exist.
    echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
    goto :EOF

:SetPath
rem Finally exec the java program and end here.
call %java_exe% -Dcom.android.sdkmanager.toolsdir="%tools_dir%" -Dcom.android.sdkmanager.workdir=%work_dir% -classpath "%jar_path%;%swt_path%\swt.jar" com.android.sdkmanager.Main %*

rem EOF`

the variables are as so

ANDROID_SWT = ;C:\android-sdk-windows\tools\lib\x86_64
解决方案

You are using the private JRE for JDK as your Java location suggest

Java location  -  C:\Program Files\Java\jdk1.6.0_24\jre\bin

If you had installed a public JRE (which is available to all Java Applications and not limited to JDK) your Java Location would be something like this

C:\Program Files\Java\jre1.6.0_24\bin

But Android SDK manager can works with private JRE.

Try setting the PATH environment variable for Java.

Refer
How do I set or change the PATH system variable? or
How to Add, Remove or Edit Environment variables in Windows 7?

After you have set the PATH variable start SDK Manager.exe

It should work now.


Edit

You are setting the PATH wrong

Java JDK  -  C:\Program Files\Java\jdk1.6.0_24
Java location  -  C:\Program Files\Java\jdk1.6.0_24\jre\bin

remove the above PATH and set the PATH as

C:\Program Files\Java\jdk1.6.0_24\bin

This should work. It works for me on jdk1.6.0_20


Edit

Did you read

Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM

Install a 64-bit JDK for a 64-bit JVMand set the PATH accordingly.


The question is now getting longer.
Let this question address SDK manager does not find Java and post another question with reference to this question and the other specific error you get.

这篇关于SDK管理器不查看java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 01:23