THRIFT-5584: use gradle toolchain to specify Java 11 with --release 8 (#2606)

* use gradle toolchain to specify Java 11 with --release 8
* use newer syntax
* fix spotless apply
* remove legacy apply and bump version of spot bugs
* migrate pmd to new plugin syntax
diff --git a/lib/java/gradle.properties b/lib/java/gradle.properties
index dfa29fe..b375fad 100644
--- a/lib/java/gradle.properties
+++ b/lib/java/gradle.properties
@@ -27,10 +27,10 @@
 # Dependency versions
 httpclient.version=4.5.13
 httpcore.version=4.4.15
-slf4j.version=1.7.35
+slf4j.version=1.7.36
 servlet.version=4.0.1
 tomcat.embed.version=9.0.43
 junit.version=5.8.2
 mockito.version=1.10.19
 javax.annotation.version=1.3.2
-commons-lang3.version=3.12
+commons-lang3.version=3.12.0