That isn’t Java, but spring.
That said, if on the JVM, just use Kotlin.
Or Clojure, Scala, Groovy.
and with the GraalVM, JavaScript/Node, Python, R, and Ruby.
among many others.