It is necessary for now, primarily to support building the data-formatting-module against an *installed* Zorba with the util-jvm module. In that case, util-jvm's CMakeLists.txt won't be run, so FIND_PACKAGE(Java) and (JNI) won't be run either.
A better solution would probably be to add those two FIND_PACKAGE() calls, with the associated JAVA_HOME trickery, to util-jvm's use file (util-jvm-module/config/UtilJavaUse.cmake), and then have data-formatting and schema-tools include the use file in the same way that the EXI module does. (Ideally util-jvm's own CMakeLists.txt would also include its own use file so that the code would exist in exactly one place, but I'm not totally sure how to accomplish that.)
It is necessary for now, primarily to support building the data-formatting -module against an *installed* Zorba with the util-jvm module. In that case, util-jvm's CMakeLists.txt won't be run, so FIND_PACKAGE(Java) and (JNI) won't be run either.
A better solution would probably be to add those two FIND_PACKAGE() calls, with the associated JAVA_HOME trickery, to util-jvm's use file (util-jvm- module/ config/ UtilJavaUse. cmake), and then have data-formatting and schema-tools include the use file in the same way that the EXI module does. (Ideally util-jvm's own CMakeLists.txt would also include its own use file so that the code would exist in exactly one place, but I'm not totally sure how to accomplish that.)