It would appear that since -select-java-non-android is invoked via
antcall, which acts like a sub-shell, definitions within that target do
not persist. So then when these properties are referenced in other
targets, the Wrong Thing happens. In particular, the Java 6
ScriptEngineFactory classes are not built in the java-classes and
xml-classes targets because the definition of has-java6 has gone out of
scope.
The attached patch moves the definitions of the has-java{2,4,5,6,7,8}
properties out of the -select-java-non-android target up to top-level.
Unrelatedly, it adds gnu/q2/lang/ to java-classes.