This is an internal development and architecture issue.
We have 3 separate "codebases" around detecting the Android SDK/NDK and the JDK/JAVA_HOME.
For developers building our SDK, we have some logic I wrote up in our "scons" scripts: https://github.com/appcelerator/titanium_mobile/tree/master/build/lib/android
For SDK users (Titanium/Appc CLI) we delegate to node-titanium-sdk: https://github.com/appcelerator/node-titanium-sdk/blob/master/lib/android.js
Which also delegates the jdk/Java stuff to node-apps: https://github.com/appcelerator/node-appc/blob/master/lib/jdk.js
And for the Daemon, it uses androidlib and jdklib:
(And although not explicit, it really also uses https://github.com/appcelerator/appcd-plugin-jdk/blob/master/src/jdk-info-service.js to scan Windows registry, etc)
We should not keep re-inventing the wheel repeatedly here. We should be re-using the same logic to detect these pieces regardless of whether we are building the SDK, using the SDK or using the daemon.