Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
205 views
in Technique[技术] by (71.8m points)

titanium - Android Build Error: Unable to locate Java VM. Please set JAVA_HOME environment variable

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 FilesJavajdk1.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)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...