Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-15818

CLI: Android: Incorrect JAVA_HOME passed into titanium_prep

    Details

      Description

      When building for device in Linux (Ubuntu in this case), the build fails if JAVA_HOME is incorrect.

      ...
       
      [INFO]  Processing JavaScript files
      [DEBUG] Copying and minifying /home/chris/Desktop/testapp/Resources/app.js => /home/chris/Desktop/testapp/build/android/assets/app.js
      [INFO]  Encrypting JavaScript files: /home/chris/.titanium/mobilesdk/linux/3.2.0.v20131125103938/android/titanium_prep.linux64 "com.appcelerator.testapp" "/home/chris/Desktop/testapp/build/android/assets" "app.js" "_app_props_.json"
      [ERROR] Failed to encrypt JavaScript files
      [ERROR] Program launch failed. Unable to locate Java VM. Please set JAVA_HOME environment variable.
      

      JAVA_HOME is required for titanium_prep to run. If it's not set, then the CLI will try to autodetect the JAVA_HOME and pass that into titanium_prep. If JAVA_HOME is set and is invalid, titanium_prep will error.

      This will require changes to both the Titanium SDK and node-appc.

      node-appc
      node-appc's jdk detection library needs to improve JAVA_HOME detection, specifically looking for JAVA_HOME/lib/<i386|amd64>/<client|server>/libjvm.so or JAVA_HOME/jre/lib/<i386|amd64>/<client|server>/libjvm.so. If these are not found, then it needs to add an issue JDK_INVALID_JAVA_HOME with description.

      Titanium SDK
      Android build needs to check if JDK_INVALID_JAVA_HOME is set and if so, fail.

        Attachments

          Activity

            People

            • Assignee:
              cbarber Chris Barber
              Reporter:
              cbarber Chris Barber
              Reviewer:
              Allen Yeung
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-17907
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code