Java indeed gets a bad rap (sometimes deservedly, sometimes not) but has been making great strides, both as a language and a platform.
I'd point out a few things:
- Groovy is technically optionally-typed. You can use dynamic or static typing when coding in Groovy.
- Reduced boilerplate is really just a cosmetic benefit of Java Records. The real benefits are things like destructors and pattern matching, to which Records open the door, and which are being seriously floated around as future additions to the Java language. Take a look at Scala case classes and pattern matching for an example.
- Another bright light in Java's futures are the plethora of fast, lightweight frameworks: Vert.x, Quarkus, Micronaut, Lagum, etc, that are well-suited to today's programming trends, and provide an alternative to traditional frameworks like EE and Spring.
I do believe that the "alternate" JVM languages will continue to be the place where innovation occurs, and that the Java language will cautiously adopt some of the better ones later down the road.