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:
- Instal JDK 10 if not done already.
- Open the terminal.
- cd to the titanium_mobile/build directory.
- Enter: node scons.js build android
Build fails due to missing "javah" tool.
Build with JDK 8 or 9.
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.
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.