Improve compatibility of build-java-android.sh