title: AOSP 4.2.2: Cannot load 32-bit SWT libraries on 64-bit JVM
body: <p>I am having problems running any AOSP commands after building. After <code>make</code>ing the source I do the following:</p>
  
  <pre><code>$ lunch full-eng
  $ android
  </code></pre>
  
  <p>What happens:</p>
  
  <pre><code>Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
      at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
      at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
      at org.eclipse.swt.internal.C.&lt;clinit&gt;(Unknown Source)
      at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
      at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
      at org.eclipse.swt.widgets.Display.&lt;clinit&gt;(Unknown Source)
      at com.android.sdkmanager.Main.showSdkManagerWindow(Main.java:330)
      at com.android.sdkmanager.Main.doAction(Main.java:318)
      at com.android.sdkmanager.Main.run(Main.java:118)
      at com.android.sdkmanager.Main.main(Main.java:101)
  </code></pre>
  
  <p>I can't seem to find any solution to this. I am attempting to build <a href="https://android.googlesource.com/platform/manifest/+/android-4.2.2_r1.2b" rel="nofollow">AOSP 4.2.2_r1.2b</a>. I have built 4.0.4 before and not had this problem. I am running this version of java:</p>
  
  <pre><code>java version "1.6.0_45"
  Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
  Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
  </code></pre>
  
  <p>Here is the command that the <code>android</code> bash file (<code>/media/android/source/sdk/sdkmanager/app/etc/android</code>) generates:</p>
  
  <pre><code>java \
      -Xmx256M \
      -classpath /media/android/source/out/host/linux-x86/framework/sdkmanager.jar:/media/android/source/out/host/linux-x86/framework/swtmenubar.jar:/media/android/source/prebuilts/tools/linux-x86_64/swt/swt.jar \
      -Dcom.android.sdkmanager.toolsdir=/media/android/source/out/host/linux-x86/bin \
      com.android.sdkmanager.Main
  </code></pre>
  
  <p>Note how it still selects the 64 bit version of SWT.</p>
  
  <p>I am aware of <a href="http://code.google.com/p/android/issues/detail?can=2&amp;start=0&amp;num=100&amp;q=&amp;colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&amp;groupby=&amp;sort=&amp;id=43481" rel="nofollow">this thread</a>. However, I have attempted solution 1 and it does not work. The other fixes appear too deep rooted for a new AOSP download and build...</p>
  
  <p>Any help/guidance would be much appreciated thanks.</p>