0

I know this is a common problem, and I have tried several solutions and none of them work for me.

I have deleted everything and started over. Could someone try to help me to get this to work?

I have these folders:
C:\Android\adt-bundle-windows-x86_64-20140702
C:\Android\android-ndk-r8e
C:\Android\android-sdk-windows
C:\Program Files\Java\jdk1.7.0_67
C:\Program Files\Java\jdk1.8.0_05
C:\Program Files\Java\jre7
C:\Program Files\Java\jre8

When trying to run android.bat:

C:\Android\android-sdk-windows\tools>android.bat
'xcopy' is not recognized as an internal or external command,
operable program or batch file.
ERROR: SWT folder 'lib\x86_64' does not exist.
Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Jeggy
  • 1,474
  • 1
  • 19
  • 35

3 Answers3

3

Android currently support up to Java 7 (JDK 1.7). If you use JDK 1.8, it won't work.

Also, assuming you're using Java 7, set up JAVA_HOME in Environment Variables by pointing it to C:\Program Files\Java\jdk1.7.0_71 so the Android SDK Manager knows which Java version to use.

On Windows 64-bit, Environment Variables can be accessed by going to Start | Control Panel | System | Advanced System Settings | System Properties | Advance | Environment Variables option. Note: You may need to restart Windows for the changes to take effect.

CAVEAT: On Windows 8.1, if the above steps fail, then install the Android SDK from the installer_r23.0.2-windows.exe executable which can be downloaded from here. Also, ensure that you uninstall JDK 1.8 from Windows 8.1 and only use JDK 1.7 with Android SDK Manager (or 1.6 if you need it).

ChuongPham
  • 4,761
  • 8
  • 43
  • 53
  • I have Installed jdk1.7 now, and changed the JAVA_HOME variable in "My Computer > Properties > Advanced system settings > Environment Variables." to "C:\Program Files\Java\jdk1.7.0_67". But it's still not working. I don't know if im using Java 7 or 8, how do I make sure of using Java 7? – Jeggy Sep 21 '14 at 16:02
  • Did you set the `JAVA_HOME` variable under the **System Variables** section? You may need to restart Windows for the changes to take effect. – ChuongPham Sep 21 '14 at 16:04
  • I just it in both "System Variables" and "User variables for $NAME" – Jeggy Sep 21 '14 at 16:06
  • You don't need to set it up in the **User Variables** section. – ChuongPham Sep 21 '14 at 16:07
  • Alright, I deleted it again. But do you know whats wrong with my setup? I have the output from running "C:\Android\android-sdk-windows\tools\android.bat" in the question, maybe that holds some information? – Jeggy Sep 21 '14 at 16:09
  • The error message is referring to the missing **swt.jar** found under the Android SDK directory, namely ../android-sdk/tools/lib/x86_64/ directory. Maybe you haven't install or unpack the Android SDK properly. – ChuongPham Sep 21 '14 at 16:16
  • I have the file there :/ and it uses 1620kb, which seems about right? – Jeggy Sep 21 '14 at 16:21
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/61631/discussion-between-chuongpham-and-jeggy). – ChuongPham Sep 21 '14 at 16:21
0

I think there is still a problem with your environment variable Path, could you check that there is a URL to your java 1.7 bin path? e.g. C:\Program Files (x86)\Java\jdk1.6.0_29\bin

You could also try from suggested here https://developer.appcelerator.com/question/136334/xcopy-is-not-recognized-as-an-internal-or-external-command:

Add this to your path variable:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files (x86)\Java\jdk1.6.0_29\bin
NFoerster
  • 386
  • 2
  • 16
0

please check if the ANDROID_SWT environment variable is pointing to a correct folder (i.e. sdk\tools\lib\x86 in your adt folder).

Jakki
  • 349
  • 4
  • 6