title: Android Build Error: Unable to locate Java VM. Please set JAVA_HOME environment variable
body: <p>I'm using Ti Studio on Win7, and my project builds and works when I have my Android plugged in via USB and I run using "Android Device".</p>
  
  <p>However, when I try to buid it for distribution I get:</p>
  
  <pre><code>[ERROR] Program launch failed. Unable to locate Java VM. Please set JAVA_HOME environment variable.
  </code></pre>
  
  <p>I have looked at <a href="http://developer.appcelerator.com/question/146294/program-launch-failed-unable-to-locate-java-vm-please-set-javahome-environment-variable" rel="nofollow">this thread</a> which describes a similar problem, and verified that JAVA_HOME is set:</p>
  
  <pre><code>+&amp;gt;echo %JAVA_HOME%
  C:\Program Files\Java\jdk1.6.0_29
  </code></pre>
  
  <p>Also, in Ti Studio I have verified that Preferences->Studio->Platforms->Android has the "Android SDK Home" set to the path where Android SDK is installed.</p>
  
  <p>Can anyone guide me on what else I need to do to fix this?</p>
  
  <p>Thanks!</p>
  
  <h3>UPDATE FOR ANAND</h3>
  
  <pre><code>+&gt;javac -version
  javac 1.6.0_29
  
  +&gt;java -version
  java version "1.7.0_01"
  Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
  Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)
  </code></pre>