Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Android and JDK 6 on Mac OSX Leopard

Titanium requires JDK 6 to work with Andriod platfrom. I had the default JDK 5 installed on my Mac, but I was also able to install JDK 6. When I run the android emulator in Titanium, I get the following message: "[Error] Java 1.5.0_x" and it stops the building process. I have set the new JDK 1.6.0 in the JAVA_HOME environment variable, and also put the tools folder in PATH.

How can I change Titanium to point to my new JDK. It clearly seems like Titanium isn't finding it.

PS: After running commands "javac -version" and "java -version", I have confirmed that it is pointing at JDK 6. My eclipse Java preferences are also pointing at JDK 6.

— asked May 21st 2010 by I Singh
  • android
  • jdk
  • mac
  • mobile
0 Comments

5 Answers

  • Just hit this issue on the Mac I've got here.. it's running Mac OSX 10.6.2. This is what I did to fix it (after about 5 hours messing with it!);

    Run the 'Java Preferences' app, then drag 'Java SE 6' to the top of the 2 lists. Restart Titanium and all should be well.

    (this replaces my previous answer were I messed with the CurrentJDK symbolic links.. that appeared to work at first, but messed up a lot of core Java stuff.. here's the blog post that helped me out; http://www.rich-software.com/wp/2009/07/switching-java-versions-on-a-mac-setting-java_home-and-using-java-6-revisited/).

    — answered June 3rd 2010 by Matt Collinge
    permalink
    0 Comments
  • I assume you have restarted Titanium Developer since switching the environment variables? Our build scripts should pick up the differences in configuration on a restart.

    — answered May 21st 2010 by Kevin Whinnery
    permalink
    0 Comments
  • I am also having this problem in the terminal its also showing that I'm using 1.6 … I have reinstalled titanium and rebooted the machine and still no joy… also perhaps relevant is that the titanium is still showing Version 1.2.1 in the about and title bar of the app window

    — answered May 21st 2010 by hayden chambers
    permalink
    0 Comments
  • Have you used the Java preferences app to change your default JDK?

    — answered May 21st 2010 by Don Thorp
    permalink
    1 Comment
    • Just drag and drop JAVA SE 6 as the first option in both the select box, it is a precedence list ;)

      It also resolve th eproblem with appcellerator!!

      — commented June 27th 2010 by mogui mogui
  • Kevin, I have restarted (both Titanium and computer). Is there some configuration file, I could provide to debug this.

    Here's what it shows on the console:
    [INFO] Launching Android emulator…one moment
    [INFO] Creating new Android Virtual Device (3 HVGA)
    [INFO] Building SS for Android … one moment
    [ERROR] JDK version 1.5.0_24

    And, the emulator does open up with Android running, but the application doesn't make it there.

    hayden, 1.2.1 is the Titanium application's version. 1.3.0 is the Titanium SDK version. Notice the difference.

    Don, I think "Java preferences" may have something to do with it. The problem is that when you install Java 6 on Leopard, you have to do it through SoyLatte (google it), but it is not added to the "Java Preferences" app.

    But applications like eclipse/NetBeans can be set to any JDK. Can Titanium be made to do the same thing?

    — answered May 22nd 2010 by I Singh
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.