Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3180] Android: JAVA_HOME not recognized when launching some Android applications

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-12-19T18:27:02.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 23, 2013 Sprint 23 Core, 2013 Sprint 26, 2013 Sprint 26 Core, Release 3.2.0
ComponentsAndroid, Tooling
Labelsandroidbuild, cb-verified, core
ReporterJonathan Knapp
AssigneeChris Barber
Created2011-04-15T03:38:57.000+0000
Updated2013-12-19T19:04:11.000+0000

Description

Googled and found that spaces in the Java paths would create complications: http://developer.appcelerator.com/question/34701/error-jdk-version-javac-is-not-recognized-as-an-internal-or-external-command-testing-on-android We moved the JDK location to C:\Java\java-jdk-folder and it appeared to work fine after updating JAVA_HOME and the Path environment variables to the new location.

Comments

  1. Jonathan Knapp 2011-04-15

    This problem appeared when compiling the app from within Titanium, so I'm guessing it doesn't play nice with path names with spaces in them.

  2. Chris Barber 2013-11-11

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/4930
  3. Chris Barber 2013-11-11

    To test, try setting JAVA_HOME to nothing, a path that is not the Java JDK home dir, and a path that is the Java JDK home dir. For each JAVA_HOME value, do a Android device build which will encrypt the JS and trigger "titanium_prep".
  4. Samuel Dowse 2013-12-18

    Reopening based on conversation with [~cbarber]. JAVA_HOME if set in incorrect location will throw an error. JAVA_HOME if set in correct location will build successfully. JAVA_HOME if not set at all will throw an error.
    C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\longjohn\dist\longjohn.js:184
               throw e;
                     ^
       TypeError: Arguments to path.resolve must be strings
           at exports.resolve (path.js:116:15)
           at Object.realpathSync (fs.js:1207:18)
           at C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\node-appc\lib\jdk.js:108:28
           at Array.forEach (native)
           at C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\node-appc\lib\jdk.js:107:29
           at C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\async\lib\async.js:530:17
           at C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\async\lib\async.js:116:25
           at C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\async\lib\async.js:24:16
           at C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\async\lib\async.js:527:21
           at C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\node-appc\lib\jdk.js:98:6
       ---------------------------------------------
           at C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\async\lib\async.js:693:21
           at Array.forEach (native)
           at _each (C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\async\lib\async.js:32:24)
           at _insert (C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\async\lib\async.js:678:11)
           at q.push (C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\async\lib\async.js:705:15)
           at findExecutable (C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\node-appc\lib\subprocess.js:113:8)
           at tasks.(anonymous function) (C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\node-appc\lib\jdk.js:97:5)
           at C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\node_modules\async\lib\async.js:521:25
  5. Chris Barber 2013-12-18

    node-appc master pull request: https://github.com/appcelerator/node-appc/pull/77 node-appc 3.2.x pull request: https://github.com/appcelerator/node-appc/pull/79
  6. Lokesh Choudhary 2013-12-19

    Uninstalled CLI 3.2.0-cr3 & reinstalled it but still can see the issue. I think it does not have the new changes in node-appc which fixes this issue. Reopening. Environment: Appcel Studio : 3.2.0.201312181652 Ti SDK : 3.2.0.v20131218153242 Mac OSX : 10.8.5 Alloy : 1.3.0-cr2 CLI - 3.2.0-cr3
  7. Chris Barber 2013-12-19

    @Lokesh, you have to install the Titanium CLI from git:
       sudo npm install -g git://github.com/appcelerator/titanium.git#3_2_X
       
  8. Lokesh Choudhary 2013-12-19

    Pulled CLI from
    sudo npm install -g git://github.com/appcelerator/titanium.git#3_2_X
    & could not reproduce the issue. tested by setting: JAVA_HOME to invalid path JAVA_HOME to none In both cases the jdk was successfully detected. Closing. Environment: Ti sdk : 3.2.0.v20131218153242 Appc studio : 3.2.0.201312181652 CLI : from sudo npm install -g git://github.com/appcelerator/titanium.git#3_2_X

JSON Source