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

Android: Cannot build SDK with JDK 10 (missing javah tool)

    Details

    • Story Points:
      3
    • Sprint:
      2016 Sprint 17 SDK

      Description

      Summary:
      If you attempt to build the Titanium SDK (ie: titanium_mobile) with JDK 10 installed, the build will fail due to a missing "javah" tool. This tool has been removed in JDK 10.

      Steps to reproduce:

      1. Instal JDK 10 if not done already.
      2. Open the terminal.
      3. cd to the titanium_mobile/build directory.
      4. Enter: node scons.js build android

      Result:
      Build fails due to missing "javah" tool.

      Work-Around:
      Build with JDK 8 or 9.

      Recommended Solution:
      Remove Titanium's usage of the "javah" tool and the #include's to the generated headers files. They're not needed.

      The generated header files and function prototypes are useless by themselves. We have to create the function implementation ourselves, which we've already done and they're already publicly exported via JNIEXPORT in their respective C++ files. Since the implementation side already exports the functions, the function prototypes are not needed.
      https://github.com/appcelerator/titanium_mobile/blob/master/android/runtime/v8/src/native/JSDebugger.cpp
      https://github.com/appcelerator/titanium_mobile/blob/master/android/runtime/v8/src/native/V8Object.cpp
      https://github.com/appcelerator/titanium_mobile/blob/master/android/runtime/v8/src/native/V8Runtime.cpp


      Original Description:
      JDK 10 has dropped the javah tool (http://openjdk.java.net/jeps/313) which is required by our tooling when building the Android platform. We need to use javac's -h flag instead. javah generated the header files from the compiled .class files in the jars, however javac -h used the original .java files.

      We'll likely have to move the header generation out of the native compile step and into the Java compile step. We can do this by specifying the nativeheaderdir attribute in the javac task in the common.xml file. However, the nativeheaderdir attribute is only supported in ant 1.9.8+ (https://ant.apache.org/manual/Tasks/javac.html) and we ship ant 1.8.0 with Titanium. The Android build also depends on ant-contrib and ant-nodeps which may not be compatible with ant 1.9.8 or newer.

      In the meantime, we'll have to use JDK 9 to build the Titanium SDK.

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              cbarber Chris Barber
              Reviewer:
              Gary Mathews
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code