[KARAF-2830] Set the Java version check more "flexible"