Allow to build the Java parts with Gradle from both Qt5 and Qt6

Needs latest ECM to work.
5 jobs for !66 with work/qt6-gradle-fix in 3 minutes and 15 seconds (queued for 3 seconds)
latest merge request