Appcelerator Q&A Archive

Search the archived Community Support

A new Titanium issue popped up today. When compiling for Android I get the following error:

[ERROR] Titanium requires JDK 1.6 when building on Mac OS X.
[ERROR] You can download it from http://appcelerator.com/jdk-osx
[ERROR] If you still see this message, then you may need to set the JAVA_HOME to help Titanium locate the JDK.
[ERROR] To see which JDKs Titanium finds, run "ti info --types jdk --output json".

The only Java version installed is:

/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home

Full output of the suggested command:

{
"jdk": {
    "jdks": {
        "1.7.0_80": {
            "home": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home",
            "version": "1.7.0",
            "build": "80",
            "executables": {
                "java": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java",
                "javac": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/javac",
                "keytool": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/keytool",
                "jarsigner": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/jarsigner"
            },
            "architecture": "64bit"
        }
    },
    "home": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home",
    "version": "1.7.0",
    "build": "80",
    "executables": {
        "java": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java",
        "javac": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/javac",
        "keytool": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/keytool",
        "jarsigner": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/jarsigner"
    },
    "issues": [],
    "architecture": "64bit"
}
}

This used to work earlier (couple of weeks ago). Nothing was changed on this machine. No Java updates, no version of Java removed. I did update Titanium CLI and SDK to the latest versions though.
So, does Titanium really "require" JDK 1.6, or is something else wrong?

OK, Update: this only pops up when selecting SDK version 5.1.0.v20150920231221.
It works when selecting SDK version 4.1.1.v20150816214206

This is all so fragile ...

2015, September 22nd by Ace McLoud in Q&A 2015

Answers

  • @Ace-McLoud Titanium SDK 5.1 is not out yet, please use 5.0.0.GA

    2015, September 22nd by Fokke
  • @Fokke Unfortunately I'm still getting the same error:

    ti build --platform android
    Titanium Command-Line Interface, CLI version 5.0.4, Titanium SDK version 5.0.0.GA
    Copyright (c) 2012-2015, Appcelerator, Inc.  All Rights Reserved.
    
    Please report bugs to http://jira.appcelerator.org/
    
    [ERROR] Titanium requires JDK 1.6 when building on Mac OS X.
    [ERROR] You can download it from http://appcelerator.com/jdk-osx
    [ERROR] If you still see this message, then you may need to set the JAVA_HOME to help  Titanium locate the JDK.
    [ERROR] To see which JDKs Titanium finds, run "ti info --types jdk --output json".
    2015, September 25th by Ace McLoud
  • @Ace-McLoud What does appc ti setup check tell you about what Titanium finds about Java? It should work fine with Java 6-8. Did you set JAVA_HOME?

    2015, September 28th by Fokke
  • @Fokke I am getting the same error, any ideas how to fix the error ??

    Screen Shot 2015-09-30 at 3.30.17 PM.png

    Output of appc ti info --types jdk --output json is as below,

    Screen Shot 2015-09-30 at 3.31.04 PM.png

    And output for appc ti setup check is as below,

    Screen Shot 2015-09-30 at 3.32.53 PM.png

    2015, September 30th by rtellakula
  • @Ace-McLoud @Fokke I am also experiencing the exact same problem. My environment status is pretty much identical to what is posted above.

    2015, September 30th by ashleysmith1989
  • @Kondal-Kolipaka I currently have 1.7.0 installed.

    2015, October 1st by ashleysmith1989
  • @Kondal-Kolipaka Link that you have provided states that a min. JDK version of 1.6 is required, I already have 1.7 on my Mac and it still is looking for 1.6. Can you please let us know how to resolve this issue ?

    2015, October 1st by rtellakula
  • @Kondal-Kolipaka This helped me! The install of the java 6 runtime from apple

    2015, October 2nd by falcko
  • @rtellakula The link also says:

    Android Development on OS X systems requires Java 6 runtime to be installed.

    So please make sure 6 is installed.

    2015, October 2nd by Fokke
  • @Shawn Thanks, that appears to have done the trick. Although the machine wasn't updated to El Cap. Same machine, no changes, simply trying to use Ti SDK 5.
    What got me confused/asking was the fact that JDK 1.6 wasn't required with Titanium SDK 4.1.1, which worked with JDK 1.7

    So a newer version of Ti SDK requires and older version of JDK ...

    Anyways, thanks again to you and the others with helpful answers in this thread. (@Fokke)

    2015, October 12th by Ace McLoud
  • @Ace-McLoud Titanium 4.1.1 required JDK 1.6 as well, but only for Android development, which is what it is required for on Ti 5 as well. Ti 5.1 will no longer.

    2015, October 12th by Fokke
  • One inconsistency possibly adding to the confusion is that, depending on the --output format, the info command sometimes seem to skip reporting the Apple bundled 1.6 JDK:

    Compare ti info --types os,jdk:

    Titanium Command-Line Interface, CLI version 5.0.3, Titanium SDK version 5.0.2.GA
    Copyright (c) 2012-2015, Appcelerator, Inc.  All Rights Reserved.
    
    Please report bugs to http://jira.appcelerator.org/
    
    Operating System
      Name                        = Mac OS X
      Version                     = 10.10.5
      Architecture                = 64bit
      # CPUs                      = 4
      Memory                      = 4.0GB
    
    Java Development Kit
      Version                     = 1.7.0_80
      Java Home                   = /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
    
    Issues
      No issues detected! Your development environment should be working perfectly!
    

    to ti info --types os,jdk --output json:

    {
        "os": {
            "name": "Mac OS X",
            "version": "10.10.5",
            "architecture": "64bit",
            "numcpus": 4,
            "memory": 4294967296
        },
        "jdk": {
            "jdks": {
                "1.7.0_80": {
                    "home": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home",
                    "version": "1.7.0",
                    "build": "80",
                    "executables": {
                        "java": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java",
                        "javac": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/javac",
                        "keytool": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/keytool",
                        "jarsigner": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/jarsigner"
                    },
                    "architecture": "64bit"
                },
                "1.6.0_65": {
                    "home": "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home",
                    "version": "1.6.0",
                    "build": "65",
                    "executables": {
                        "java": "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java",
                        "javac": "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/javac",
                        "keytool": "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/keytool",
                        "jarsigner": "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/jarsigner"
                    },
                    "architecture": "32bit"
                }
            },
            "home": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home",
            "version": "1.7.0",
            "build": "80",
            "executables": {
                "java": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java",
                "javac": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/javac",
                "keytool": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/keytool",
                "jarsigner": "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/jarsigner"
            },
            "issues": [],
            "architecture": "64bit"
        }
    }
    
    2015, October 14th by Fifi
  • @Fifi the first tells you what it selected, the second is what our software uses internally and includes all JDKs it found plus (concluding) the one selected.