Extract java cross-compilation to separate child class (as a preparation step for K2JS support)