Fix build of jar file with cmake >= 3.12 (try #2).
(cherry picked from commit 7727ed2b76d9fac788bf6bdefbbf49a0425a10e8)
this test used too much memory for build slaves, divide by 4 the buffer size
(cherry picked from commit b60816bd929521783f045ec907fd540efda16e9f)