0

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".

However, when I try to buid it for distribution I get:

[ERROR] Program launch failed. Unable to locate Java VM. Please set JAVA_HOME environment variable.

I have looked at this thread which describes a similar problem, and verified that JAVA_HOME is set:

+>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_29

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.

Can anyone guide me on what else I need to do to fix this?

Thanks!

UPDATE FOR ANAND

+>javac -version
javac 1.6.0_29

+>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)
Jonah
  • 15,806
  • 22
  • 87
  • 161
  • Make sure you have set all environment variables. To check this open your command prompt type following commands `java`, `javac`, `adb` if any of this has failed, you need to set the variable properly – Anand Nov 13 '13 at 04:38
  • Hi Andand, all three of those commands work fine. Other ideas? – Jonah Nov 13 '13 at 04:46
  • Which version of OS you have 32 or 64? – Anand Nov 13 '13 at 04:47

2 Answers2

1

Did you read System Requirements?

From Documentation:

For Windows, the 32-bit version of Java JDK is required regardless of whether Titanium is running on a 32-bit or 64-bit system.

Try to install additional 32bit version of Java (without removing the 64bit) and set the system variable.

You may refer this answer.

Hope it helped you

Community
  • 1
  • 1
Anand
  • 5,323
  • 5
  • 44
  • 58
  • Anand, I have upated my OP with info about the java versions I see from the command line. I am a little confused though: I have multiple versions of java installed on my machine -- do I need to change which version are executed by default system wide (ie, by changing my PATH) or is it a configuration within TiStudio I need to make? – Jonah Nov 13 '13 at 05:08
  • You have to change the path of java to 32 bit version. Because titanium works with 32 bit java only. I have updated my answer. I did a mistake in the links – Anand Nov 13 '13 at 05:28
  • Ok I tried this, but it did not help. I now have `>which java` returning `C:\Program Files (x86)\Java\jre6\bin\java.EXE` but I get the same error as in the original OP during the android build to distribute process. – Jonah Nov 13 '13 at 09:50
1

Configure environment variables as mentioned here and JDK must be 32 bit

Muhammad Adnan
  • 2,668
  • 15
  • 27