Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Trouble Starting Android SDK Executables
New Posts  All Forums:Forum Nav:

Trouble Starting Android SDK Executables - Page 2

post #11 of 13
Thread Starter 
Originally Posted by Plan9 View Post

set java_exe= is incomplete. You need the path to java.exe (if java.exe is in %PATH% then you can get away with just putting "java.exe" in that line. Else you'll need the full path.

That's where the call in the next line comes from. find_java.bat returns the location, which gets put into java_exe. If it didn't, then hardcoding the path to archquery.jar wouldn't work.

I'm 100% that the script is fine; if by no other reason that there's no chance that Google could keep including it in the SDK if it was broken. It's gotta be some issue with my setup. I had the SDK working a long time ago. But since I uninstalled it, something changed that's breaking the local referencing of the script.

Not to mention I CAN launch the SDK through the android.bat script after modifying it with the JDK path. It's when I try the executables that it breaks.
Edited by EfemaN - 10/16/12 at 2:43pm
post #12 of 13
You're not really giving me a whole lot to go on.

* Can you give me the content of all the batch files.
* Give me an outline of your directory structures
* And post your environmental variables

I'm fairly certain it's an env not getting set somewhere, but really i can't do a whole lot without any idea of how your computer is set up.


oh, and you've not added cd etc like I've recommended
post #13 of 13
Thread Starter 
I realized I was confusing a lot of things; forget basically everything else, and I'm pretty sure this problem isn't even worth pursuing, since literally the only thing it affects is the ability to launch the SDK or AVD using the executables.

The problem is that the executables 'SDK Manager.exe' and 'AVD Manager.exe' located in D:\android-sdk\ don't work right. I believe all they do (or need to do) is run the command 'tools\android.bat' with either 'sdk' or 'avd' as the parameter. Running those commands myself in that folder works fine, the apps launch. But hitting the executables does the DOS flash, with no error output.

The problem with providing the batch files is that launching android.bat (after hardcoding the path to that jar) does work. I'm pretty sure it's something to do with the executables, which would make sense that it's to do with Path. However, I have D:\android-sdk\ in path.
Android.bat (Click to show)
rem don't modify the caller's environment

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;lib\swtmenubar.jar

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

    rem Copy android.bat and its required libs to a temp dir.
    rem This avoids locking the tool dir in case the user is trying to update it.

    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
    copy /B /D /Y lib\swtmenubar.jar     %tmp_dir%\lib\        > nul
    copy /B /D /Y lib\commons-logging*   %tmp_dir%\lib\        > nul
    copy /B /D /Y lib\commons-codec*     %tmp_dir%\lib\        > nul
    copy /B /D /Y lib\httpclient*        %tmp_dir%\lib\        > nul
    copy /B /D /Y lib\httpcore*          %tmp_dir%\lib\        > nul
    copy /B /D /Y lib\httpmime*          %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%


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

rem Finally exec the java program and end here.
REM set REMOTE_DEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
call %java_exe% %REMOTE_DEBUG% -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 only difference I made to this was to hardcode the path to archquery.jar. The line previously read '... -jar lib\archquery.jar'.

Originally Posted by Plan9 View Post

oh, and you've not added cd etc like I've recommended

'cd /d %~dp0' is called earlier in android.bat to set the directory.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Trouble Starting Android SDK Executables