I also ran into this, and what I found was that in JDK17, the deflate library is bundled with the Java runtime environment; in JDK8, it uses the system's zlib. And the bundled version is very slightly less efficient than the system version for me: if you pass the compressed stream to infgen, you can see that it uses a literal token instead of a backreference sometimes. I tried iterating over all combinations of Deflater parameters I could, but I couldn't get the two implementations to produce the same output stream.
(For people who are curious why I care at all, I'm using deflate in a compression-based similarity measure, and this change slightly perturbs my "golden output" tests.)